Skip to content

Commit 2433674

Browse files
authored
Merge pull request #376 from dflook/arm
Add Linting checks
2 parents 79af378 + e4f005d commit 2433674

File tree

80 files changed

+647
-307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+647
-307
lines changed

.config/.markdownlint.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
line-length:
2+
line_length: 200
3+
tables: false
4+
no-inline-html:
5+
allowed_elements: ['p', 'img']
6+
ul-style:
7+
style: sublist
8+

.config/changelog.markdownlint.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
line-length:
2+
line_length: 300
3+
no-inline-html:
4+
allowed_elements: ['p', 'img']
5+
ul-style:
6+
style: sublist
7+
no-duplicate-heading:
8+
siblings_only: true
9+
blanks-around-headings:
10+
lines_below: 0
11+
blanks-around-lists: false

.github/actionlint.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
self-hosted-runner:
2+
# Labels of self-hosted runner in array of strings.
3+
labels: []
4+
5+
# Configuration variables in array of strings defined in your repository or
6+
# organization. `null` means disabling configuration variables check.
7+
# Empty array means no configuration variable is allowed.
8+
config-variables: []
9+
10+
# Configuration for file paths. The keys are glob patterns to match to file
11+
# paths relative to the repository root. The values are the configurations for
12+
# the file paths. Note that the path separator is always '/'.
13+
# The following configurations are available.
14+
#
15+
# "ignore" is an array of regular expression patterns. Matched error messages
16+
# are ignored. This is similar to the "-ignore" command line option.
17+
paths:
18+
.github/workflows/*.yaml:
19+
ignore:
20+
- 'file "/entrypoints/.*\.sh" does not exist'
21+
- 'property "output_string" is not defined in object type'
22+
- 'property "my.*" is not defined in object type'
23+
- 'property "from_.*" is not defined in object type'
24+
- 'property "complex_output" is not defined in object type'
25+
- 'property "v" is not defined in object type'
26+
- 'property "test" is not defined in object type'
27+
- 'property "default" is not defined in object type'
28+
- 'property "len" is not defined in object type'
29+
- 'property "https" is not defined in object type'
30+
- 'property "git_https" is not defined in object type'
31+
- 'property "awkward_.*" is not defined in object type'
32+
- 'property "word" is not defined in object type'
33+
.github/workflows/test-target-replace.yaml:
34+
ignore:
35+
- 'property "count" is not defined in object type'
36+
- 'property "foreach" is not defined in object type'
37+
.github/workflows/release.yaml:
38+
ignore:
39+
- 'Useless cat.'
40+
.github/workflows/test-version.yaml:
41+
ignore:
42+
- 'property "random" is not defined in object type'
43+
- 'property "acme" is not defined in object type'

.github/workflows/base-image.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ jobs:
3333
env:
3434
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
3535
run: |
36-
echo $DOCKER_TOKEN | docker login --username danielflook --password-stdin
36+
echo "$DOCKER_TOKEN" | docker login --username danielflook --password-stdin
3737
3838
- name: Set up Docker Buildx
39-
uses: docker/setup-buildx-action@v2
39+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
4040

4141
- name: Base image
4242
id: build-and-push
4343
run: |
4444
docker buildx build \
45-
--tag danielflook/terraform-github-actions-base:$GITHUB_RUN_ID \
45+
--tag "danielflook/terraform-github-actions-base:$GITHUB_RUN_ID" \
4646
--tag danielflook/terraform-github-actions-base:latest \
4747
--platform linux/amd64,linux/arm64 \
48-
--attest type=provenance,mode=max,builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID \
48+
--attest "type=provenance,mode=max,builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
4949
--annotation "index,manifest:org.opencontainers.image.created=$(date '+%Y-%m-%dT%H:%M:%S%z')" \
5050
--annotation "index,manifest:org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
5151
--annotation "index,manifest:org.opencontainers.image.revision=${{ github.sha }}" \

.github/workflows/pull_request_review.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Test pull_request_review event
33
on:
44
- pull_request_review
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
apply:
811
runs-on: ubuntu-24.04

.github/workflows/release.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ jobs:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
4040
run: |
41-
echo $GITHUB_TOKEN | docker login ghcr.io --username dflook --password-stdin
42-
echo $DOCKER_TOKEN | docker login --username danielflook --password-stdin
41+
echo "$GITHUB_TOKEN" | docker login ghcr.io --username dflook --password-stdin
42+
echo "$DOCKER_TOKEN" | docker login --username danielflook --password-stdin
4343
4444
- name: Set up Docker Buildx
45-
uses: docker/setup-buildx-action@v2
45+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
4646

4747
- name: Build action image
4848
id: image_build
@@ -51,7 +51,7 @@ jobs:
5151
GH_TOKEN: ${{ github.token }}
5252
run: |
5353
BASE_TAG=$(docker buildx imagetools inspect danielflook/terraform-github-actions-base:latest --format '{{json .}}' | jq -r '.manifest.annotations."ref.tag"')
54-
BASE_DIGEST=$(docker buildx imagetools inspect danielflook/terraform-github-actions-base:$BASE_TAG --format '{{json .}}' | jq -r '.manifest.digest')
54+
BASE_DIGEST=$(docker buildx imagetools inspect "danielflook/terraform-github-actions-base:$BASE_TAG" --format '{{json .}}' | jq -r '.manifest.digest')
5555
5656
gh attestation verify --repo dflook/terraform-github-actions "oci://index.docker.io/danielflook/terraform-github-actions-base@$BASE_DIGEST"
5757
@@ -63,7 +63,7 @@ jobs:
6363
--tag "danielflook/terraform-github-actions:$RELEASE_TAG" \
6464
--tag "ghcr.io/dflook/terraform-github-actions:$RELEASE_TAG" \
6565
--platform linux/amd64,linux/arm64 \
66-
--attest type=provenance,mode=max,builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID \
66+
--attest "type=provenance,mode=max,builder-id=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
6767
--annotation "index,manifest:org.opencontainers.image.created=$(date '+%Y-%m-%dT%H:%M:%S%z')" \
6868
--annotation "index,manifest:org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
6969
--annotation "index,manifest:org.opencontainers.image.revision=${{ github.sha }}" \
@@ -125,8 +125,10 @@ jobs:
125125
RELEASE_TAG: "${{ github.event.release.tag_name }}"
126126
IMAGE_DIGEST: ${{ needs.image.outputs.digest }}
127127
run: |
128-
export major=$(echo "$RELEASE_TAG" | cut -d. -f1)
129-
export minor=$(echo "$RELEASE_TAG" | cut -d. -f2)
128+
major=$(echo "$RELEASE_TAG" | cut -d. -f1)
129+
minor=$(echo "$RELEASE_TAG" | cut -d. -f2)
130+
export major
131+
export minor
130132
131133
function prepare_release() {
132134
rsync -r "$GITHUB_WORKSPACE/$action/" "$HOME/$action"

.github/workflows/repository_dispatch.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Repository Dispatch
22

3-
on: [repository_dispatch]
3+
on:
4+
repository_dispatch:
45

56
env:
67
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/retain-images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
- name: docker pull
2525
run: |
2626
for tag in $(git tag); do
27-
docker pull --quiet danielflook/terraform-github-actions:$tag
27+
docker pull --quiet "danielflook/terraform-github-actions:$tag"
2828
docker system prune --all --force
2929
done

.github/workflows/test-cloud.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ jobs:
616616
exit 1
617617
fi
618618
619-
if ! grep -q "Terraform will perform the following actions" $SAVED_PLAN_TEXT_PLAN_PATH; then
619+
if ! grep -q "Terraform will perform the following actions" "$SAVED_PLAN_TEXT_PLAN_PATH"; then
620620
echo "::error:: text_plan_path not set correctly"
621621
exit 1
622622
fi

.github/workflows/test-plan.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
JSON_PLAN_PATH: ${{ steps.plan.outputs.json_plan_path }}
3434
TEXT_PLAN_PATH: ${{ steps.plan.outputs.text_plan_path }}
3535
PLAN_PATH: ${{ steps.plan.outputs.plan_path }}
36-
RUN_ID: ${{ steps.apply.outputs.run_id }}
36+
RUN_ID: ${{ steps.plan.outputs.run_id }}
3737
run: |
3838
echo "changes=$CHANGES"
3939
@@ -94,7 +94,7 @@ jobs:
9494
env:
9595
JSON_PLAN_PATH: ${{ steps.plan.outputs.json_plan_path }}
9696
TEXT_PLAN_PATH: ${{ steps.plan.outputs.text_plan_path }}
97-
RUN_ID: ${{ steps.apply.outputs.run_id }}
97+
RUN_ID: ${{ steps.plan.outputs.run_id }}
9898
run: |
9999
cat "$JSON_PLAN_PATH"
100100
if [[ $(jq -r .format_version "$JSON_PLAN_PATH") != "1.2" ]]; then
@@ -656,7 +656,7 @@ jobs:
656656
env:
657657
JSON_PLAN_PATH: ${{ steps.plan.outputs.json_plan_path }}
658658
TEXT_PLAN_PATH: ${{ steps.plan.outputs.text_plan_path }}
659-
RUN_ID: ${{ steps.apply.outputs.run_id }}
659+
RUN_ID: ${{ steps.plan.outputs.run_id }}
660660
run: |
661661
cat "$JSON_PLAN_PATH"
662662
if [[ $(jq -r .output_changes.s.actions[0] "$JSON_PLAN_PATH") != "create" ]]; then
@@ -699,7 +699,7 @@ jobs:
699699
env:
700700
OUTCOME: ${{ steps.plan.outcome }}
701701
TEXT_PLAN_PATH: ${{ steps.plan.outputs.text_plan_path }}
702-
RUN_ID: ${{ steps.apply.outputs.run_id }}
702+
RUN_ID: ${{ steps.plan.outputs.run_id }}
703703
run: |
704704
if [[ "$OUTCOME" != "failure" ]]; then
705705
echo "Plan did not fail correctly"
@@ -754,7 +754,7 @@ jobs:
754754
OUTCOME: ${{ steps.plan.outcome }}
755755
JSON_PLAN_PATH: ${{ steps.plan.outputs.json_plan_path }}
756756
TEXT_PLAN_PATH: ${{ steps.plan.outputs.text_plan_path }}
757-
RUN_ID: ${{ steps.apply.outputs.run_id }}
757+
RUN_ID: ${{ steps.plan.outputs.run_id }}
758758
run: |
759759
if [[ "$OUTCOME" != "failure" ]]; then
760760
echo "Plan did not fail correctly"
@@ -800,7 +800,7 @@ jobs:
800800
OUTCOME: ${{ steps.plan.outcome }}
801801
JSON_PLAN_PATH: ${{ steps.plan.outputs.json_plan_path }}
802802
TEXT_PLAN_PATH: ${{ steps.plan.outputs.text_plan_path }}
803-
RUN_ID: ${{ steps.apply.outputs.run_id }}
803+
RUN_ID: ${{ steps.plan.outputs.run_id }}
804804
run: |
805805
if [[ "$OUTCOME" != "failure" ]]; then
806806
echo "Plan did not fail correctly"

0 commit comments

Comments
 (0)