Skip to content

Commit c5ffc71

Browse files
authored
add actionlint workflow (#740)
close: #737
1 parent c3e76c6 commit c5ffc71

File tree

5 files changed

+67
-30
lines changed

5 files changed

+67
-30
lines changed

.github/workflows/actionlint.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Lint GitHub Actions workflows
2+
3+
on:
4+
push:
5+
paths:
6+
- ".github/workflows/*.ya?ml"
7+
pull_request:
8+
paths:
9+
- ".github/workflows/*.ya?ml"
10+
11+
jobs:
12+
actionlint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Download actionlint
17+
id: get_actionlint
18+
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/2ab3a12c7848f6c15faca9a92612ef4261d0e370/scripts/download-actionlint.bash)
19+
shell: bash
20+
- name: Check workflow files
21+
# - https://www.shellcheck.net/wiki/SC2016 - "Expressions don't expand in single quotes, use double quotes for that."
22+
run: ${{ steps.get_actionlint.outputs.executable }} -color -ignore 'SC2016'
23+
shell: bash

.github/workflows/ci.yml

+14-10
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ jobs:
125125
id: branch-info
126126
run: |
127127
set -ex
128-
echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
129-
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
130-
echo "TAG_NAME=$(.github/workflows/get_py_prerelease_name.sh)" >> $GITHUB_OUTPUT
131-
echo "PYTHON_BINDINGS_CHANGED=$(.github/workflows/python_bindings_changed.sh)" >> $GITHUB_OUTPUT
128+
{
129+
echo "COMMIT=$(git rev-parse HEAD)"
130+
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}"
131+
echo "TAG_NAME=$(.github/workflows/get_py_prerelease_name.sh)"
132+
echo "PYTHON_BINDINGS_CHANGED=$(.github/workflows/python_bindings_changed.sh)"
133+
} >> "$GITHUB_OUTPUT"
132134
133135
- name: Upload artifact
134136
uses: actions/upload-artifact@v4
@@ -333,10 +335,12 @@ jobs:
333335
id: branch-info
334336
run: |
335337
set -ex
336-
echo "COMMIT=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
337-
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
338-
echo "TAG_NAME=$(.github/workflows/get_wasm_prerelease_name.sh)" >> $GITHUB_OUTPUT
339-
echo "WASM_CHANGED=$(.github/workflows/wasm_pkg_changed.sh)" >> $GITHUB_OUTPUT
338+
{
339+
echo "COMMIT=$(git rev-parse HEAD)"
340+
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}"
341+
echo "TAG_NAME=$(.github/workflows/get_wasm_prerelease_name.sh)"
342+
echo "WASM_CHANGED=$(.github/workflows/wasm_pkg_changed.sh)"
343+
} >> "$GITHUB_OUTPUT"
340344
341345
- name: Build WASM module
342346
if: steps.branch-info.outputs.WASM_CHANGED != 0
@@ -436,9 +440,9 @@ jobs:
436440
.github/workflows/is_crate_version_already_uploaded.sh trustfall_derive
437441
export TRUSTFALL_DERIVE="$?"
438442
if [[ "$TRUSTFALL" == "7" && "$TRUSTFALL_CORE" == "7" && "$TRUSTFALL_DERIVE" == "7" ]]; then
439-
echo 'is_new_version=no' >> $GITHUB_OUTPUT
443+
echo 'is_new_version=no' >> "$GITHUB_OUTPUT"
440444
elif [[ "$TRUSTFALL" == "0" || "$TRUSTFALL_CORE" == "0" || "$TRUSTFALL_DERIVE" == "0" ]]; then
441-
echo 'is_new_version=yes' >> $GITHUB_OUTPUT
445+
echo 'is_new_version=yes' >> "$GITHUB_OUTPUT"
442446
else
443447
# Unexpected outcome, indicates a bug.
444448
exit 1

.github/workflows/dependencies.yml

+22-14
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,17 @@ jobs:
9595
run: |
9696
set -euo pipefail
9797
98-
echo "${CARGO_COMMIT_MESSAGE}" > commit.txt
99-
cat cargo_update.log >> commit.txt
100-
101-
echo "${MAIN_CARGO_PR_MESSAGE}" > body.md
102-
echo '```txt' >> body.md
103-
cat cargo_update.log >> body.md
104-
echo '```' >> body.md
98+
{
99+
echo "${CARGO_COMMIT_MESSAGE}"
100+
cat cargo_update.log
101+
} >> commit.txt
102+
103+
{
104+
echo "${MAIN_CARGO_PR_MESSAGE}"
105+
echo '```txt'
106+
cat cargo_update.log
107+
echo '```'
108+
} >> body.md
105109
106110
- name: commit
107111
run: |
@@ -227,13 +231,17 @@ jobs:
227231
run: |
228232
set -euo pipefail
229233
230-
echo "${CARGO_COMMIT_MESSAGE}" > commit.txt
231-
cat cargo_update.log >> commit.txt
232-
233-
echo "${FUZZ_CARGO_PR_TITLE}" > body.md
234-
echo '```txt' >> body.md
235-
cat cargo_update.log >> body.md
236-
echo '```' >> body.md
234+
{
235+
echo "${CARGO_COMMIT_MESSAGE}"
236+
cat cargo_update.log
237+
} >> commit.txt
238+
239+
{
240+
echo "${FUZZ_CARGO_PR_MESSAGE}"
241+
echo '```txt'
242+
cat cargo_update.log
243+
echo '```'
244+
} >> body.md
237245
238246
- name: commit
239247
run: |

.github/workflows/publish-python.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
- name: Tag the version
3333
run: |
3434
set -euxo pipefail
35-
export CURRENT_VERSION="$(.github/workflows/get_current_crate_version.sh trustfall)"
35+
CURRENT_VERSION="$(.github/workflows/get_current_crate_version.sh trustfall)"
36+
export CURRENT_VERSION
3637
git tag "pytrustfall-v$CURRENT_VERSION"
3738
git push origin "pytrustfall-v$CURRENT_VERSION"
3839
@@ -257,9 +258,9 @@ jobs:
257258
export EXIT_CODE="$?"
258259
set -e
259260
if [[ "$EXIT_CODE" == "7" ]]; then
260-
echo 'is_new_version=no' >> $GITHUB_OUTPUT
261+
echo 'is_new_version=no' >> "$GITHUB_OUTPUT"
261262
elif [[ "$EXIT_CODE" == "0" ]]; then
262-
echo 'is_new_version=yes' >> $GITHUB_OUTPUT
263+
echo 'is_new_version=yes' >> "$GITHUB_OUTPUT"
263264
else
264265
# Unexpected outcome, indicates a bug.
265266
exit "$EXIT_CODE"

.github/workflows/publish-rust.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ jobs:
4343
- name: Tag the version
4444
run: |
4545
set -euxo pipefail
46-
export CURRENT_VERSION="$(.github/workflows/get_current_crate_version.sh ${{ inputs.crate-name }})"
46+
CURRENT_VERSION="$(.github/workflows/get_current_crate_version.sh ${{ inputs.crate-name }})"
47+
export CURRENT_VERSION
4748
git tag "${{ inputs.crate-name }}-v$CURRENT_VERSION"
4849
git push origin "${{ inputs.crate-name }}-v$CURRENT_VERSION"
4950
@@ -68,9 +69,9 @@ jobs:
6869
export EXIT_CODE="$?"
6970
set -e
7071
if [[ "$EXIT_CODE" == "7" ]]; then
71-
echo 'is_new_version=no' >> $GITHUB_OUTPUT
72+
echo 'is_new_version=no' >> "$GITHUB_OUTPUT"
7273
elif [[ "$EXIT_CODE" == "0" ]]; then
73-
echo 'is_new_version=yes' >> $GITHUB_OUTPUT
74+
echo 'is_new_version=yes' >> "$GITHUB_OUTPUT"
7475
else
7576
# Unexpected outcome, indicates a bug.
7677
exit "$EXIT_CODE"

0 commit comments

Comments
 (0)