Skip to content

Commit b350549

Browse files
authored
ci: add support for actionlint (#152)
* add actionlint workflow * apply actionlint fixes * fix
1 parent 722e1ee commit b350549

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

.github/workflows/actionlint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint GitHub Actions workflows
2+
on: [push, pull_request]
3+
4+
jobs:
5+
actionlint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Check workflow files
10+
uses: docker://rhysd/actionlint:latest
11+
with:
12+
args: -color -ignore SC2086

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Find the Go Build Cache
5656
id: go
57-
run: echo "::set-output name=cache::$(make go.cachedir)"
57+
run: echo "cache=$(make go.cachedir)" >> "$GITHUB_OUTPUT"
5858

5959
- name: Cache the Go Build Cache
6060
uses: actions/cache@v4
@@ -95,7 +95,7 @@ jobs:
9595

9696
- name: Find the Go Build Cache
9797
id: go
98-
run: echo "::set-output name=cache::$(make go.cachedir)"
98+
run: echo "cache=$(make go.cachedir)" >> "$GITHUB_OUTPUT"
9999

100100
- name: Cache the Go Build Cache
101101
uses: actions/cache@v4
@@ -128,7 +128,7 @@ jobs:
128128

129129
- name: Find the Go Build Cache
130130
id: go
131-
run: echo "::set-output name=cache::$(make go.cachedir)"
131+
run: echo "cache=$(make go.cachedir)" >> "$GITHUB_OUTPUT"
132132

133133
- name: Cache the Go Build Cache
134134
uses: actions/cache@v4
@@ -147,7 +147,7 @@ jobs:
147147
uses: codecov/codecov-action@v5
148148
with:
149149
flags: unittests
150-
file: _output/tests/linux_amd64/coverage.txt
150+
files: _output/tests/linux_amd64/coverage.txt
151151

152152
local-deploy:
153153
runs-on: ubuntu-24.04
@@ -167,7 +167,7 @@ jobs:
167167

168168
- name: Find the Go Build Cache
169169
id: go
170-
run: echo "::set-output name=cache::$(make go.cachedir)"
170+
run: echo "cache=$(make go.cachedir)" >> "$GITHUB_OUTPUT"
171171

172172
- name: Cache the Go Build Cache
173173
uses: actions/cache@v4
@@ -222,7 +222,7 @@ jobs:
222222

223223
- name: Find the Go Build Cache
224224
id: go
225-
run: echo "::set-output name=cache::$(make go.cachedir)"
225+
run: echo "cache=$(make go.cachedir)" >> "$GITHUB_OUTPUT"
226226

227227
- name: Cache the Go Build Cache
228228
uses: actions/cache@v4
@@ -248,4 +248,4 @@ jobs:
248248
path: _output/**
249249

250250
- name: Publish Artifacts
251-
run: make publish BRANCH_NAME=${GITHUB_REF##*/}
251+
run: make publish BRANCH_NAME="${GITHUB_REF##*/}"

.github/workflows/codeql.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ on:
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: [ "main" ]
20-
merge_group:
2120
schedule:
2221
- cron: '26 4 * * 2'
2322

.github/workflows/e2e.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,31 @@ jobs:
5353
gh pr checkout ${{ github.event.issue.number }}
5454
git submodule update --init --recursive
5555
OUTPUT=$(git log -1 --format='%H')
56-
echo "commit-sha=$OUTPUT" >> $GITHUB_OUTPUT
56+
echo "commit-sha=$OUTPUT" >> "$GITHUB_OUTPUT"
5757
5858
- name: Prepare The Example List
5959
env:
6060
COMMENT: ${{ github.event.comment.body }}
6161
id: get-example-list-name
6262
run: |
63-
PATHS=$(echo $COMMENT | sed 's/^.*\/test-examples="//g' | cut -d '"' -f 1 | sed 's/,/ /g')
63+
PATHS=$(echo "$COMMENT" | sed 's/^.*\/test-examples="//g' | cut -d '"' -f 1 | sed 's/,/ /g')
6464
EXAMPLE_LIST=""
65-
for P in $PATHS; do EXAMPLE_LIST="${EXAMPLE_LIST},$(find $P -name '*.yaml' | tr '\n' ',')"; done
65+
for P in $PATHS; do EXAMPLE_LIST="${EXAMPLE_LIST},$(find "$P" -name '*.yaml' | tr '\n' ',')"; done
6666
6767
sudo apt-get -y install coreutils
68-
COUNT=$(echo ${EXAMPLE_LIST:1} | grep -o ".yaml" | wc -l)
69-
if [ $COUNT -gt 1 ]; then EXAMPLE_HASH=$(echo ${EXAMPLE_LIST} | md5sum | cut -f1 -d" "); else EXAMPLE_HASH=$(echo ${EXAMPLE_LIST:1} | sed 's/.$//'); fi
68+
COUNT=$(echo "${EXAMPLE_LIST:1}" | grep -o ".yaml" | wc -l)
69+
if [ "$COUNT" -gt 1 ]; then
70+
EXAMPLE_HASH=$(echo "${EXAMPLE_LIST}" | md5sum | cut -f1 -d" ");
71+
else
72+
EXAMPLE_HASH=${EXAMPLE_LIST:1}
73+
EXAMPLE_HASH=${EXAMPLE_HASH%,}
74+
fi
7075
7176
echo "Examples: ${EXAMPLE_LIST:1}"
7277
echo "Example Hash: ${EXAMPLE_HASH}"
7378
74-
echo "example-list=${EXAMPLE_LIST:1}" >> $GITHUB_OUTPUT
75-
echo "example-hash=${EXAMPLE_HASH}" >> $GITHUB_OUTPUT
79+
echo "example-list=${EXAMPLE_LIST:1}" >> "$GITHUB_OUTPUT"
80+
echo "example-hash=${EXAMPLE_HASH}" >> "$GITHUB_OUTPUT"
7681
7782
- name: Create Pending Status Check
7883
env:
@@ -123,7 +128,7 @@ jobs:
123128
gh pr checkout ${{ github.event.issue.number }}
124129
git submodule update --init --recursive
125130
OUTPUT=$(git log -1 --format='%H')
126-
echo "commit-sha=$OUTPUT" >> $GITHUB_OUTPUT
131+
echo "commit-sha=$OUTPUT" >> "$GITHUB_OUTPUT"
127132
128133
- name: Vendor Dependencies
129134
run: make vendor vendor.check
@@ -169,7 +174,7 @@ jobs:
169174
- name: Cleanup
170175
if: always()
171176
run: |
172-
eval $(make --no-print-directory build.vars)
177+
eval "$(make --no-print-directory build.vars)"
173178
${KUBECTL} delete managed --all || true
174179
175180
- name: Create Unsuccessful Status Check

0 commit comments

Comments
 (0)