diff --git a/.github/workflows/close-pull-request.yml b/.github/workflows/close-pull-request.yml index e283e0815..9a9fccda7 100644 --- a/.github/workflows/close-pull-request.yml +++ b/.github/workflows/close-pull-request.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Remove environment after a PR is closed run: | - cat $GITHUB_EVENT_PATH | curl \ + cat "$GITHUB_EVENT_PATH" | curl \ -X POST \ --header "Content-Type: application/json" \ --header "X-GitHub-Delivery: ${RUNNER_TRACKING_ID:7}" \ diff --git a/.github/workflows/scaffold-release-docs.yml b/.github/workflows/scaffold-release-docs.yml index afb3a7b59..21eb9915f 100644 --- a/.github/workflows/scaffold-release-docs.yml +++ b/.github/workflows/scaffold-release-docs.yml @@ -21,7 +21,6 @@ jobs: release-docs: environment: name: github-pages - url: ${{ steps.pages.outputs.page_url }} runs-on: ubuntu-latest diff --git a/.github/workflows/scaffold-test-common.yml b/.github/workflows/scaffold-test-common.yml index 653ac986a..3e915084b 100644 --- a/.github/workflows/scaffold-test-common.yml +++ b/.github/workflows/scaffold-test-common.yml @@ -45,12 +45,12 @@ jobs: - name: Generate test SSH key pair used for deployment tests run: | - mkdir -p $HOME/.ssh - ssh-keygen -t rsa -b 4096 -m PEM -N '' -f $HOME/.ssh/id_rsa - chmod 600 $HOME/.ssh/id_rsa - echo "$(ssh-agent -a ${HOME}/ssh-agent.sock)" > ssh-agent-output + mkdir -p "$HOME/.ssh" + ssh-keygen -t rsa -b 4096 -m PEM -N '' -f "$HOME/.ssh/id_rsa" + chmod 600 "$HOME/.ssh/id_rsa" + ssh-agent -a "${HOME}/ssh-agent.sock" > ssh-agent-output export SSH_AUTH_SOCK=$(grep SSH_AUTH_SOCK ssh-agent-output | cut -d';' -f1 | cut -d= -f2) - echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> $GITHUB_ENV + echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> "$GITHUB_ENV" - name: Install dependencies run: npm ci @@ -79,7 +79,7 @@ jobs: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - drevops-test-workflow: + scaffold-test-workflow: runs-on: ubuntu-latest strategy: @@ -130,7 +130,7 @@ jobs: fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} - drevops-test-deployment: + scaffold-test-deployment: runs-on: ubuntu-latest strategy: @@ -162,12 +162,12 @@ jobs: - name: Generate test SSH key pair used for deployment tests run: | - mkdir -p $HOME/.ssh - ssh-keygen -t rsa -b 4096 -m PEM -N '' -f $HOME/.ssh/id_rsa - chmod 600 $HOME/.ssh/id_rsa - echo "$(ssh-agent -a ${HOME}/ssh-agent.sock)" > ssh-agent-output - export SSH_AUTH_SOCK=$(grep SSH_AUTH_SOCK ssh-agent-output | cut -d';' -f1 | cut -d= -f2) - echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> $GITHUB_ENV + mkdir -p "$HOME/.ssh" + ssh-keygen -t rsa -b 4096 -m PEM -N '' -f "$HOME/.ssh/id_rsa" + chmod 600 "$HOME/.ssh/id_rsa" + ssh-agent -a "${HOME}/ssh-agent.sock" > ssh-agent-output + export SSH_AUTH_SOCK="$(grep SSH_AUTH_SOCK ssh-agent-output | cut -d';' -f1 | cut -d= -f2)" + echo "SSH_AUTH_SOCK=${SSH_AUTH_SOCK}" >> "$GITHUB_ENV" - name: Install dependencies run: npm ci @@ -189,3 +189,18 @@ jobs: directory: /tmp/.scaffold-coverage-html fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} + + scaffold-test-actions: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check coding standards with yamllint + run: yamllint --config-file .scaffold/tests/.yamllint-for-gha.yml .github/workflows + continue-on-error: ${{ vars.DREVOPS_CI_YAMLLINT_IGNORE_FAILURE == '1' }} + + - name: Check coding standards with actionlint + run: docker run --rm -v "${GITHUB_WORKSPACE:-.}":/app --workdir /app rhysd/actionlint:1.6.27 -ignore 'SC2002:' -ignore 'SC2155:' + continue-on-error: ${{ vars.DREVOPS_CI_ACTIONLINT_IGNORE_FAILURE == '1' }} diff --git a/.scaffold/tests/.yamllint-for-gha.yml b/.scaffold/tests/.yamllint-for-gha.yml new file mode 100644 index 000000000..3b57fffef --- /dev/null +++ b/.scaffold/tests/.yamllint-for-gha.yml @@ -0,0 +1,17 @@ +# Yamllint configuration file used to check GitHub Actions configuration files. +extends: default + +rules: + comments: + min-spaces-from-content: 1 + document-start: + present: false + empty-lines: + max: 1 + max-start: 0 + max-end: 0 + line-length: + max: 255 + truthy: + allowed-values: ['true', 'false'] + check-keys: false