Update GitHub workflows to Node v20 (#174694)

* update linter workflows

* bump actions script to v7

* bump actions stale to v9

* update workspace recommendations

* add expression markers
This commit is contained in:
David
2024-03-27 17:21:27 +01:00
committed by GitHub
parent c5c68a51d9
commit d68f670548
9 changed files with 46 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
name: AGLint
env:
NODE_VERSION: 18
NODE_VERSION: 20
on:
push:
@@ -38,24 +38,27 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile
# If the linter found any errors, it will exit with a non-zero code,
# which will cause the job to fail
# If the linter found any errors, it will exit with a non-zero code, which will cause the job to fail
- name: Run AGLint
run: yarn lint
notify:
name: Send Slack notification on failure
runs-on: ubuntu-latest
# We should wait for the lint job to finish before handling the notification
needs: lint
# With always() we can run this job even if the previous job failed, but we also
# should check if the event is push or the PR is coming from the same repository
if: ${{ always() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) }}
# Run this job only if the previous job failed and the event was triggered by the 'AdguardTeam/AdguardFilters' repository
# Note: 'always()' is needed to run the notify job even if the lint job was failed
if:
${{
always() &&
needs.lint.result == 'failure' &&
github.repository == 'AdguardTeam/AdguardFilters' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
)
}}
steps:
# Get the workflow conclusion
- uses: technote-space/workflow-conclusion-action@v3
# Send a Slack notification if the conclusion is failure
- uses: 8398a7/action-slack@v3
with:
status: failure
@@ -64,4 +67,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }}

View File

@@ -6,10 +6,10 @@ on:
jobs:
assign:
if: github.repository == 'AdguardTeam/AdguardFilters'
if: ${{ github.repository == 'AdguardTeam/AdguardFilters' }}
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |

View File

@@ -6,10 +6,10 @@ on:
jobs:
remove_labels_assignees:
if: github.repository == 'AdguardTeam/AdguardFilters'
if: ${{ github.repository == 'AdguardTeam/AdguardFilters' }}
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
@@ -17,13 +17,13 @@ jobs:
const repo = context.repo.repo;
const issueNumber = context.issue.number;
var issueLabelsRaw = await github.rest.issues.listLabelsOnIssue({
const issueLabelsRaw = await github.rest.issues.listLabelsOnIssue({
owner,
repo,
issue_number: issueNumber,
});
var issueLabels = issueLabelsRaw.data.map((el) => el.name);
const issueLabels = issueLabelsRaw.data.map((el) => el.name);
const labelsToRemove = [ 'A: Resolved', 'A: Cannot reproduce', 'A: In progress', 'A: Waiting for data' ];
for (let label of labelsToRemove) {

View File

@@ -1,7 +1,7 @@
name: markdownlint
env:
NODE_VERSION: 18
NODE_VERSION: 20
on:
push:
@@ -40,24 +40,27 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile
# If the linter found any errors, it will exit with a non-zero code,
# which will cause the job to fail
# If the linter found any errors, it will exit with a non-zero code, which will cause the job to fail
- name: Run markdownlint
run: yarn markdownlint .
notify:
name: Send Slack notification on failure
runs-on: ubuntu-latest
# We should wait for the lint job to finish before handling the notification
needs: lint
# With always() we can run this job even if the previous job failed, but we also
# should check if the event is push or the PR is coming from the same repository
if: ${{ always() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) }}
# Run this job only if the previous job failed and the event was triggered by the 'AdguardTeam/AdguardFilters' repository
# Note: 'always()' is needed to run the notify job even if the lint job was failed
if:
${{
always() &&
needs.lint.result == 'failure' &&
github.repository == 'AdguardTeam/AdguardFilters' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
)
}}
steps:
# Get the workflow conclusion
- uses: technote-space/workflow-conclusion-action@v3
# Send a Slack notification if the conclusion is failure
- uses: 8398a7/action-slack@v3
with:
status: failure
@@ -66,4 +69,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }}

View File

@@ -6,10 +6,10 @@ on:
jobs:
remove_label:
if: github.repository == 'AdguardTeam/AdguardFilters'
if: ${{ github.repository == 'AdguardTeam/AdguardFilters' }}
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
@@ -17,13 +17,13 @@ jobs:
const repo = context.repo.repo;
const issueNumber = context.issue.number;
var issueLabelsRaw = await github.rest.issues.listLabelsOnIssue({
const issueLabelsRaw = await github.rest.issues.listLabelsOnIssue({
owner,
repo,
issue_number: issueNumber,
});
var issueLabels = issueLabelsRaw.data.map((el) => el.name);
const issueLabels = issueLabelsRaw.data.map((el) => el.name);
const labelsToRemove = [ 'Unsorted' ];
for (let label of labelsToRemove) {

View File

@@ -7,10 +7,10 @@ on:
jobs:
stale:
if: github.repository == 'AdguardTeam/AdguardFilters'
if: ${{ github.repository == 'AdguardTeam/AdguardFilters' }}
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v9
with:
stale-issue-message: >
This issue has been automatically marked as stale because it has been open for 4 days with no activity.

View File

@@ -7,10 +7,10 @@ on:
jobs:
stale:
if: github.repository == 'AdguardTeam/AdguardFilters'
if: ${{ github.repository == 'AdguardTeam/AdguardFilters' }}
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v9
with:
stale-issue-message: >
This issue has been automatically marked as stale because it has been open for 10 days with no activity.

View File

@@ -7,10 +7,10 @@ on:
jobs:
stale:
if: github.repository == 'AdguardTeam/AdguardFilters'
if: ${{ github.repository == 'AdguardTeam/AdguardFilters' }}
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v7
- uses: actions/stale@v9
with:
stale-issue-message: >
This issue has been automatically marked as stale because it has been open for 4 days with no activity.