Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/cancel-stale-merge-queue-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Cancel Stale Merge Queue Workflows
on:
merge_group:
types:
- destroyed

# See https://github.com/orgs/community/discussions/137976
jobs:
cancel-workflows:
name: Cancel Workflow Runs
runs-on: sentinel-general-use-runner
permissions:
actions: write
contents: read
if: github.event.reason != 'merged'
steps:
- name: Cancel Workflow Runs
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1

Check warning

Code scanning / yamllint

too few spaces before comment: expected 2 Warning

too few spaces before comment: expected 2
with:
script: |
;(await github.rest.actions.listWorkflowRunsForRepo({ ..context.repo, head_sha: context.sha }))
.data.workflow_runs
.filter(r => r.status !== 'completed' && r.id !== context.runId)
.forEach(r => github.rest.actions.cancelWorkflowRun({ ..context.repo, run_id: r.id }))
41 changes: 41 additions & 0 deletions .github/workflows/check-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Check Test
on:
- pull_request
jobs:
test:
name: test
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0

Check warning

Code scanning / yamllint

too few spaces before comment: expected 2 Warning

too few spaces before comment: expected 2
with:
go-version: '1.25.5'
- name: Install GHAlint
run: go install github.com/suzuki-shunsuke/ghalint/cmd/ghalint@latest
- name: Run GHAlint
run: ~/go/bin/ghalint run -c .github/workflows/config/.ghalint.yml &> ghalint.txt
- name: Strip ANSII Escape Sequences
if: always()
run: sed -i -E "s/\x1B\[[0-9;]*[mK]//g" ghalint.txt
- name: upload
uses: actions/upload-artifact@v4
if: always()
with:
name: ghalint-output
path: ghalint*.txt
- name: Convert
uses: ./
if: always()
with:
inputFile: ghalint.txt
sarif: false
comment: true
summary: true
toolName: 'ghalint'
inputFormat: 'ghalint'
11 changes: 11 additions & 0 deletions .github/workflows/config/.ghalint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
excludes: # These `inherit: secret`s must be used as a workaround for reusable workflows running in an environment

Check warning

Code scanning / yamllint

too few spaces before comment: expected 2 Warning

too few spaces before comment: expected 2
- policy_name: deny_inherit_secrets
workflow_file_path: .github/workflows/build-manual.yml
job_name: sign-production
- policy_name: deny_inherit_secrets
workflow_file_path: .github/workflows/build-master.yml
job_name: sign-production
- policy_name: deny_inherit_secrets
workflow_file_path: .github/workflows/build-release.yml
job_name: sign-production
4 changes: 1 addition & 3 deletions __tests__/ghalint.input.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
Jan 22 09:42:27.969 ERR the job violates policies program=ghalint version="" workflow_file_path=.github/workflows/cancel-stale-merge-queue-workflows.yml policy_name=job_timeout_minutes_is_required reference=https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/012.md job_name=cancel-workflows error="job's timeout-minutes is required"
Jan 22 09:42:27.969 ERR the job violates policies program=ghalint version="" workflow_file_path=.github/workflows/cancel-stale-merge-queue-workflows.yml reference=https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/012.md job_name=cancel-workflows error="job's timeout-minutes is required" policy_name=job_timeout_minutes_is_required
Jan 22 09:42:27.969 ERR the job violates policies program=ghalint version="" reference=https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/012.md job_name=cancel-workflows error="job's timeout-minutes is required" policy_name=job_timeout_minutes_is_required workflow_file_path=.github/workflows/cancel-stale-merge-queue-workflows.yml
Jan 22 13:12:47.427 ERR the job violates policies program=ghalint version="" workflow_file_path=.github\workflows\cancel-stale-merge-queue-workflows.yml policy_name=job_timeout_minutes_is_required reference=https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/012.md job_name=cancel-workflows error="job's timeout-minutes is required"
1 change: 1 addition & 0 deletions ghalint2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Jan 22 13:12:47.427 ERR the job violates policies program=ghalint version="" workflow_file_path=.github\workflows\cancel-stale-merge-queue-workflows.yml policy_name=job_timeout_minutes_is_required reference=https://github.com/suzuki-shunsuke/ghalint/blob/main/docs/policies/012.md job_name=cancel-workflows error="job's timeout-minutes is required"
Loading