diff --git a/.github/workflows/StalePRs.yml b/.github/workflows/StalePRs.yml
index 4a8ddd68657..4fbfc78550d 100644
--- a/.github/workflows/StalePRs.yml
+++ b/.github/workflows/StalePRs.yml
@@ -57,11 +57,11 @@ jobs:
const STALE_CLOSE_THRESHOLD_MS = 1000 * 60 * 60 * 24 * 30;
const STALE_MESSAGE =
- "Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as `Stale`.
" +
- "Feel free to remove the `Stale` label if you feel this was a mistake.
" +
- "If you are unable to remove the `Stale` label please contact a maintainer in order to do so.
" +
+ "Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as `stale`.
" +
+ "Feel free to remove the `stale` label if you feel this was a mistake.
" +
+ "If you are unable to remove the `stale` label please contact a maintainer in order to do so.
" +
"If you want the bot to never mark this PR stale again, add the `no-stale` label.
" +
- "`Stale` pull requests will automatically be closed after 30 days of inactivity.
";
+ "`stale` pull requests will automatically be closed after 30 days of inactivity.
";
let numAPIRequests = 0;
let numProcessed = 0;
@@ -79,7 +79,7 @@ jobs:
// Check if the PR is stale, according to our configured thresholds.
let staleThresholdMillis;
- if (labels.includes("Stale")) {
+ if (labels.includes("stale")) {
core.info(`[${pull.number}] PR is labeled stale, checking whether we should close it.`);
staleThresholdMillis = STALE_CLOSE_THRESHOLD_MS;
} else {
@@ -97,7 +97,7 @@ jobs:
// At this point, we know we should do something.
// For PRs already labeled stale, close them.
- if (labels.includes("Stale")) {
+ if (labels.includes("stale")) {
core.info(`[${pull.number}] Closing PR.`);
numAPIRequests += 1;
await github.rest.issues.update({
@@ -123,7 +123,7 @@ jobs:
owner: "pytorch",
repo: "tutorials",
issue_number: pull.number,
- labels: ["Stale"],
+ labels: ["stale"],
});
}
}
diff --git a/.github/workflows/link_checkPR.yml b/.github/workflows/link_checkPR.yml
index b30c33b13c0..16e6f32dd3c 100644
--- a/.github/workflows/link_checkPR.yml
+++ b/.github/workflows/link_checkPR.yml
@@ -1,59 +1,26 @@
#Checks links in a PR to ensure they are valid. If link is valid but failing, it can be added to the .lycheeignore file
-#Code source: https://github.com/lycheeverse/lychee-action/issues/238
name: link check on PR
on:
pull_request:
branches: [main]
-
jobs:
- check-links:
+ linkChecker:
runs-on: ubuntu-latest
steps:
- - name: Clone repository
- uses: actions/checkout@v4
+ - uses: actions/checkout@v4
with:
- fetch-depth: 0
- ref: ${{github.event.pull_request.head.ref}}
- repository: ${{github.event.pull_request.head.repo.full_name}}
-
- - name: Check out main branch
- run: git checkout main
-
- - name: Dump all links from main
- id: dump_links_from_main
+ fetch-depth: 1
+ - name: Get Changed Files
+ id: changed-files
+ uses: tj-actions/changed-files@v34
+ - name: Check Links
uses: lycheeverse/lychee-action@v1
with:
- args: |
- --dump
- --include-fragments
- .
- output: ./links-main.txt
-
- - name: Stash untracked files
- run: git stash push --include-untracked
-
- - name: Check out feature branch
- run: git checkout ${{ github.head_ref }}
-
- - name: Apply stashed changes
- # Apply stashed changes, ignore errors if stash is empty
- run: git stash pop || true
-
- - name: Append links-main.txt to .lycheeignore
- run: cat links-main.txt >> .lycheeignore
-
- - name: Check links
- uses: lycheeverse/lychee-action@v1
- with:
- args: |
- --no-progress
- --include-fragments
- .
- # Fail action on broken links
+ args: --accept=200,403,429 --base . --verbose --no-progress ${{ steps.changed-files.outputs.all_changed_files }}
+ token: ${{ secrets.CUSTOM_TOKEN }}
fail: true
-
- name: Suggestions
if: failure()
run: |