Skip to content

Commit

Permalink
Add actionlint & fix detected issues (#1708)
Browse files Browse the repository at this point in the history
* add actionlint

* fix issues

* ignore new json file in vitest
  • Loading branch information
djahandarie authored Dec 28, 2024
1 parent 4b97a01 commit 64dfca7
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 16 deletions.
17 changes: 17 additions & 0 deletions .github/actionlint-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}
14 changes: 14 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint GitHub Actions workflows
on: [push, pull_request]

jobs:
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check workflow files
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/v1.7.4/scripts/download-actionlint.bash)
./actionlint -color
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
shell: bash
env:
PR_NUM: ${{ github.event.number }}
run: echo $PR_NUM > pr_num.txt
run: echo "$PR_NUM" > pr_num.txt
- name: Upload the PR number
uses: actions/upload-artifact@v4
with:
name: pr_num
path: ./pr_num.txt
path: ./pr_num.txt
2 changes: 1 addition & 1 deletion .github/workflows/create-prerelease-on-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
id: hash
run: |
cd builds
echo "hashes=$(sha256sum * | base64 -w0)" >> "$GITHUB_OUTPUT"
echo "hashes=$(sha256sum -- * | base64 -w0)" >> "$GITHUB_OUTPUT"
- name: Release
id: release
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/delay.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ jobs:
inputs: |
{
"attemptNumber": "${{ github.event.inputs.attemptNumber }}",
"maxAttempts": "${{ github.event.inputs.maxAttempts }}",
"environment": "${{ github.event.inputs.environment }}"
"maxAttempts": "${{ github.event.inputs.maxAttempts }}"
}
20 changes: 11 additions & 9 deletions .github/workflows/playwright_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ jobs:
id: playwright
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "PLAYWRIGHT_OUTPUT<<$EOF" >> $GITHUB_OUTPUT
cat ./playwright-output >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
echo "MASTER_SCREENSHOTS_OUTCOME<<$EOF" >> $GITHUB_OUTPUT
cat ./master-screenshots-outcome >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
echo "FAILED=$(grep -c '^ *[0-9] failed$' $GITHUB_OUTPUT)" >> $GITHUB_OUTPUT
echo "FLAKY=$(grep -c '^ *[0-9] flaky$' $GITHUB_OUTPUT)" >> $GITHUB_OUTPUT
{
echo "PLAYWRIGHT_OUTPUT<<$EOF";
cat ./playwright-output;
echo "$EOF";
echo "MASTER_SCREENSHOTS_OUTCOME<<$EOF";
cat ./master-screenshots-outcome;
echo "$EOF";
echo "FAILED=$(grep -c '^ *[0-9] failed$' ./playwright-output)";
echo "FLAKY=$(grep -c '^ *[0-9] flaky$' ./playwright-output)"
} >> "$GITHUB_OUTPUT"
# this is required because github.event.workflow_run.pull_requests is not available for PRs from forks
- name: "Get PR information"
Expand Down Expand Up @@ -91,4 +93,4 @@ jobs:
with:
issue: ${{ steps.source-run-info.outputs.pullRequestNumber }}
message: ${{ steps.playwright-summary.outputs.summary }}
update-only: true
update-only: true
1 change: 0 additions & 1 deletion .github/workflows/publish-chrome-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
environment: cd
outputs:
result: ${{ steps.webStorePublish.outcome }}
releaseUploadUrl: ${{ steps.getZipAsset.outputs.releaseUploadUrl }}
permissions:
actions: write
contents: write
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish-chrome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
environment: cd
outputs:
result: ${{ steps.webStorePublish.outcome }}
releaseUploadUrl: ${{ steps.getZipAsset.outputs.releaseUploadUrl }}
permissions:
actions: write
steps:
Expand Down
1 change: 1 addition & 0 deletions test/data/json.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{"path": ".vscode/settings.json", "ignore": true},
{"path": ".vscode/extensions.json", "ignore": true},
{"path": ".vscode/launch.json", "ignore": true},
{"path": ".github/actionlint-matcher.json", "ignore": true},
{"path": "dev/jsconfig.json", "ignore": true},
{"path": "ext/manifest.json", "ignore": true},
{"path": "test/data/dictionaries/invalid-dictionary1/index.json", "ignore": true},
Expand Down

0 comments on commit 64dfca7

Please sign in to comment.