From 294c059e4d3a512a4f06ba08120fd004519dcb25 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 9 Oct 2025 08:42:30 +0200 Subject: [PATCH 1/2] feat(danger): Use updater action to manage Danger JS version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extract the Danger JS version to a properties file and use the updater action to automatically check for and update to new versions. Changes: - Extract version to danger/danger.properties - Read version from properties file in danger action - Add workflow to automatically update Danger JS weekly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/update-deps.yml | 21 +++++++++++++++++++++ danger/action.yml | 10 ++++++++-- danger/danger.properties | 2 ++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update-deps.yml create mode 100644 danger/danger.properties diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml new file mode 100644 index 0000000..0c851b0 --- /dev/null +++ b/.github/workflows/update-deps.yml @@ -0,0 +1,21 @@ +name: Update Danger JS + +on: + workflow_dispatch: + schedule: + # Run weekly on Mondays at 8:00 UTC + - cron: '0 8 * * 1' + +permissions: + contents: write + pull-requests: write + +jobs: + danger: + runs-on: ubuntu-latest + steps: + - uses: getsentry/github-workflows/updater@main + with: + path: danger/danger.properties + name: Danger JS + api-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/danger/action.yml b/danger/action.yml index dcdc110..56d222b 100644 --- a/danger/action.yml +++ b/danger/action.yml @@ -22,6 +22,12 @@ runs: token: ${{ inputs.api-token }} fetch-depth: 0 + # Read the Danger version from the properties file + - name: Get Danger version + id: config + shell: pwsh + run: Get-Content '${{ github.action_path }}/danger.properties' | Tee-Object $env:GITHUB_OUTPUT -Append + # Using a pre-built docker image in GitHub container registry instead of NPM to reduce possible attack vectors. - name: Run DangerJS id: danger @@ -36,5 +42,5 @@ runs: -e "INPUT_ARGS" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true \ -e GITHUB_TOKEN="${{ inputs.api-token }}" \ -e DANGER_DISABLE_TRANSPILATION="true" \ - ghcr.io/danger/danger-js:11.3.1 \ - --failOnErrors --dangerfile ${{ github.action_path }}/dangerfile.js \ No newline at end of file + ghcr.io/danger/danger-js:${{ steps.config.outputs.version }} \ + --failOnErrors --dangerfile ${{ github.action_path }}/dangerfile.js diff --git a/danger/danger.properties b/danger/danger.properties new file mode 100644 index 0000000..39ec907 --- /dev/null +++ b/danger/danger.properties @@ -0,0 +1,2 @@ +version = 11.3.1 +repo = https://github.com/danger/danger-js From 8bdb45c085af59e5d6a35031e022dd8915f68d88 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 9 Oct 2025 08:51:59 +0200 Subject: [PATCH 2/2] chore: Remove unnecessary whitespace in danger.properties --- danger/danger.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/danger/danger.properties b/danger/danger.properties index 39ec907..a6b777e 100644 --- a/danger/danger.properties +++ b/danger/danger.properties @@ -1,2 +1,2 @@ -version = 11.3.1 -repo = https://github.com/danger/danger-js +version=11.3.1 +repo=https://github.com/danger/danger-js