diff --git a/.github/workflows/Actionlint.yml b/.github/workflows/Actionlint.yml new file mode 100644 index 000000000..4e753a029 --- /dev/null +++ b/.github/workflows/Actionlint.yml @@ -0,0 +1,21 @@ +--- +name: ActionLint +on: workflow_call +env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.CREW_PR_TOKEN }} + GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }} + REVIEWDOG_TOKEN: ${{ secrets.CREW_PR_TOKEN }} +jobs: + yamllint: + runs-on: ubuntu-24.04 + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + - name: YAMLLint + uses: reviewdog/action-actionlint@6612efe1589ccf23cb1320d11fced44b86fb5ad7 # Post v1.7.4 commit to support fail_level + with: + actionlint_flags: "-shellcheck ''" + fail_level: none + reporter: github-pr-review diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 1eb6a2308..e4938b856 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -48,6 +48,7 @@ jobs: with: fetch-depth: 0 persist-credentials: true + ref: ${{ inputs.branch || github.ref_name }} - name: Rebase to master run: | git config user.name "${{ github.actor }}" @@ -288,6 +289,7 @@ jobs: with: fetch-depth: 0 persist-credentials: true + ref: ${{ inputs.branch || github.ref_name }} - name: Get all changed manifest files id: changed-manifest-files uses: tj-actions/changed-files@v45 @@ -300,6 +302,7 @@ jobs: git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" git fetch origin + git checkout ${{ env.BRANCH }} git reset --hard origin/${{ env.BRANCH }} git pull --rebase origin master && git push -f git log --oneline -10 diff --git a/.github/workflows/Linter-Handoff.yml b/.github/workflows/Linter-Handoff.yml index 0f9b5e9d8..edcd0b1e3 100644 --- a/.github/workflows/Linter-Handoff.yml +++ b/.github/workflows/Linter-Handoff.yml @@ -55,6 +55,10 @@ jobs: needs: handoff if: contains(needs.handoff.outputs.category, 'YAML') uses: ./.github/workflows/YAMLlint.yml + action-yaml: + needs: handoff + if: contains(needs.handoff.outputs.category, 'YAML') + uses: ./.github/workflows/Actionlint.yml linter-tests: runs-on: ubuntu-24.04 needs: @@ -63,6 +67,7 @@ jobs: - ruby - bash - yaml + - action-yaml if: ${{ !cancelled() }} steps: - name: fail if linter jobs failed diff --git a/.github/workflows/Markdown-lint.yml b/.github/workflows/Markdown-lint.yml index c165142c5..5c0c31796 100644 --- a/.github/workflows/Markdown-lint.yml +++ b/.github/workflows/Markdown-lint.yml @@ -1,6 +1,9 @@ --- name: Markdown-lint on: workflow_call +env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.CREW_PR_TOKEN }} + GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }} jobs: markdown-lint: runs-on: ubuntu-24.04 @@ -14,4 +17,4 @@ jobs: with: fail_level: any markdownlint_flags: '-s .mdl_style.rb' - reporter: github-pr-check + reporter: github-pr-review diff --git a/.github/workflows/Rubocop.yml b/.github/workflows/Rubocop.yml index 8ac10b1e0..1af8aaa61 100644 --- a/.github/workflows/Rubocop.yml +++ b/.github/workflows/Rubocop.yml @@ -1,6 +1,9 @@ --- name: Rubocop on: workflow_call +env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.CREW_PR_TOKEN }} + GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }} jobs: rubocop: runs-on: ubuntu-24.04 @@ -18,4 +21,4 @@ jobs: fail_level: any filter_mode: nofilter only_changed: true - reporter: github-pr-check + reporter: github-pr-review diff --git a/.github/workflows/ShellCheck.yml b/.github/workflows/ShellCheck.yml index 00a23a4d4..44c669215 100644 --- a/.github/workflows/ShellCheck.yml +++ b/.github/workflows/ShellCheck.yml @@ -1,6 +1,9 @@ --- name: ShellCheck on: workflow_call +env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.CREW_PR_TOKEN }} + GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }} jobs: shellcheck: runs-on: ubuntu-24.04 @@ -14,4 +17,4 @@ jobs: with: exclude: './tools/*' fail_level: any - reporter: github-pr-check + reporter: github-pr-review diff --git a/.github/workflows/YAMLlint.yml b/.github/workflows/YAMLlint.yml index 08dc87eb4..c10e38614 100644 --- a/.github/workflows/YAMLlint.yml +++ b/.github/workflows/YAMLlint.yml @@ -1,6 +1,9 @@ --- name: YAMLLint on: workflow_call +env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.CREW_PR_TOKEN }} + GH_TOKEN: ${{ secrets.CREW_PR_TOKEN }} jobs: yamllint: runs-on: ubuntu-24.04 @@ -13,4 +16,4 @@ jobs: uses: reviewdog/action-yamllint@v1 with: fail_level: any - reporter: github-pr-check + reporter: github-pr-review