Skip to content

Commit

Permalink
update README and file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsudol committed Dec 15, 2022
1 parent d1cf1cd commit 0cd4aef
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Required Permission: `pull-requests: write`

#### exempt-issue-labels

Comma separated list of labels that exclude the issue from being marked as stale
Comma separated list of labels that can be assigned to issues to exclude them from being marked as stale
(e.g: `question,bug`)

If unset (or an empty string), this option will not alter the stale workflow.
Expand All @@ -255,7 +255,7 @@ Default value: unset

#### exempt-pr-labels

Comma separated list of labels that exclude the pull request from being marked as stale
Comma separated list of labels that can be assigned to pull requests to exclude them from being marked as stale
(e.g: `need-help,WIP`)

If unset (or an empty string), this option will not alter the stale workflow.
Expand Down Expand Up @@ -526,7 +526,7 @@ Default value: `false`

#### remove-stale-from-exempt-items

If set to `true`, issues or pull request with an [exempt-issue-label](#exempt-issue-label) or [exempt-pr-labels](#exempt-pr-labels)
If set to `true`, issues or pull requests with an [exempt-issue-label](#exempt-issue-labels) or [exempt-pr-label](#exempt-pr-labels)
that are no longer stale will have the stale label removed.

Default value: `false`
Expand Down
12 changes: 4 additions & 8 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ class IssuesProcessor {
(_a = this.statistics) === null || _a === void 0 ? void 0 : _a.incrementProcessedItemsCount(issue);
const issueLogger = new issue_logger_1.IssueLogger(issue);
issueLogger.info(`Found this $$type last updated at: ${logger_service_1.LoggerService.cyan(issue.updated_at)}`);
const shouldIgnoreUpdates = new ignore_updates_1.IgnoreUpdates(this.options, issue).shouldIgnoreUpdates();
// calculate string based messages for this issue
const staleMessage = issue.isPullRequest
? this.options.stalePrMessage
Expand Down Expand Up @@ -536,7 +535,6 @@ class IssuesProcessor {
const isRemoveStaleFromExemptItemEnabled = this._removeStaleFromExemptItems(hasExemptLabel);
if (hasExemptLabel) {
// Determine whether we want to manage an exempt item
// Only check to see if the issue is stale if the option is enabled
const isIssueStale = isRemoveStaleFromExemptItemEnabled &&
(yield this._isIssueStale(issue, staleLabel, staleMessage));
if (isIssueStale) {
Expand Down Expand Up @@ -590,6 +588,7 @@ class IssuesProcessor {
// Determine if this issue needs to be marked stale first
if (!issue.isStale) {
issueLogger.info(`This $$type is not stale`);
const shouldIgnoreUpdates = new ignore_updates_1.IgnoreUpdates(this.options, issue).shouldIgnoreUpdates();
// Should this issue be marked as stale?
let shouldBeStale;
// Ignore the last update and only use the creation date
Expand Down Expand Up @@ -1132,12 +1131,9 @@ class IssuesProcessor {
return option_1.Option.RemoveStaleWhenUpdated;
}
/**
* Checks to see if there has been activity on an item after the issue was marked stale
* This consumes 2 operations, one to fetch when the issue was marked stale, and one to fetch the comments
* @param issue - the item we are evaluating
* @param staleLabel - the stale label we use on our items
* @param staleMessage - the stale message we use on our items
* @returns - false by default
* Checks to see if there has been activity on an item after the item was marked stale
* This consumes 2 operations, one to fetch when the item was marked stale,
* and one to fetch the comments on that item
*/
_isIssueStale(issue, staleLabel, staleMessage) {
return __awaiter(this, void 0, void 0, function* () {
Expand Down
19 changes: 8 additions & 11 deletions src/classes/issues-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ export class IssuesProcessor {
)}`
);

const shouldIgnoreUpdates: boolean = new IgnoreUpdates(
this.options,
issue
).shouldIgnoreUpdates();

// calculate string based messages for this issue
const staleMessage: string = issue.isPullRequest
? this.options.stalePrMessage
Expand Down Expand Up @@ -445,6 +440,11 @@ export class IssuesProcessor {
if (!issue.isStale) {
issueLogger.info(`This $$type is not stale`);

const shouldIgnoreUpdates: boolean = new IgnoreUpdates(
this.options,
issue
).shouldIgnoreUpdates();

// Should this issue be marked as stale?
let shouldBeStale: boolean;

Expand Down Expand Up @@ -1246,12 +1246,9 @@ export class IssuesProcessor {
}

/**
* Checks to see if there has been activity on an item after the issue was marked stale
* This consumes 2 operations, one to fetch when the issue was marked stale, and one to fetch the comments
* @param issue - the item we are evaluating
* @param staleLabel - the stale label we use on our items
* @param staleMessage - the stale message we use on our items
* @returns - false by default
* Checks to see if there has been activity on an item after the item was marked stale
* This consumes 2 operations, one to fetch when the item was marked stale,
* and one to fetch the comments on that item
*/
private async _isIssueStale(
issue: Issue,
Expand Down

0 comments on commit 0cd4aef

Please sign in to comment.