Skip to content

Commit f4ec559

Browse files
vaindclaude
andcommitted
feat!: convert workflows to composite actions
Convert moved workflow files to proper composite action structure: updater/action.yml: - Convert workflow_call trigger to composite action metadata - Flatten 3 jobs (cancel-previous-run, validate-inputs, update) into sequential steps - Convert secrets.api-token to inputs.api-token - Replace ${{ runner.temp }}/ghwf/... script paths with ${{ github.action_path }}/scripts/... - Remove _workflow_version input (no longer needed with bundled scripts) - Add proper shell declarations for all steps - Update PR body reference to point to new action location danger/action.yml: - Convert workflow_call trigger to composite action metadata - Remove _workflow_version input and wget script downloads - Replace ${{ runner.temp }}/dangerfile.js with ${{ github.action_path }}/dangerfile.js - Single job conversion to composite steps - Add proper shell declaration for Docker step Both actions now bundle scripts locally instead of downloading at runtime, improving reliability and performance. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent a1fa08e commit f4ec559

File tree

2 files changed

+274
-309
lines changed

2 files changed

+274
-309
lines changed

danger/action.yml

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,32 @@
1-
# Runs DangerJS with a pre-configured set of rules on a Pull Request.
2-
on:
3-
workflow_call:
4-
inputs:
5-
_workflow_version:
6-
description: 'Internal: specify github-workflows (this repo) revision to use when checking out scripts.'
7-
type: string
8-
required: false
9-
default: '2.14.1' # Note: this is updated during release process
10-
outputs:
11-
outcome:
12-
description: Whether the Danger run finished successfully. Possible values are success, failure, cancelled, or skipped.
13-
value: ${{ jobs.danger.outputs.outcome }}
1+
name: 'Danger JS'
2+
description: 'Runs DangerJS with a pre-configured set of rules on a Pull Request'
3+
author: 'Sentry'
144

15-
jobs:
16-
danger:
17-
runs-on: ubuntu-latest
18-
outputs:
19-
outcome: ${{ steps.danger.outcome }}
20-
steps:
21-
- uses: actions/checkout@v4
22-
with:
23-
fetch-depth: 0
5+
outputs:
6+
outcome:
7+
description: 'Whether the Danger run finished successfully. Possible values are success, failure, cancelled, or skipped.'
8+
value: ${{ steps.danger.outcome }}
249

25-
- name: Download dangerfile.js and utilities
26-
run: |
27-
wget https://raw.githubusercontent.com/getsentry/github-workflows/${{ inputs._workflow_version }}/danger/dangerfile.js -P ${{ runner.temp }}
28-
wget https://raw.githubusercontent.com/getsentry/github-workflows/${{ inputs._workflow_version }}/danger/dangerfile-utils.js -P ${{ runner.temp }}
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
2917

30-
# Using a pre-built docker image in GitHub container registry instaed of NPM to reduce possible attack vectors.
31-
- name: Run DangerJS
32-
id: danger
33-
run: |
34-
docker run \
35-
--volume ${{ github.workspace }}:/github/workspace \
36-
--volume ${{ runner.temp }}:${{ runner.temp }} \
37-
--workdir /github/workspace \
38-
--user $UID \
39-
-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 \
40-
-e GITHUB_TOKEN="${{ github.token }}" \
41-
-e DANGER_DISABLE_TRANSPILATION="true" \
42-
ghcr.io/danger/danger-js:11.3.1 \
43-
--failOnErrors --dangerfile ${{ runner.temp }}/dangerfile.js
18+
# Using a pre-built docker image in GitHub container registry instead of NPM to reduce possible attack vectors.
19+
- name: Run DangerJS
20+
id: danger
21+
shell: bash
22+
run: |
23+
docker run \
24+
--volume ${{ github.workspace }}:/github/workspace \
25+
--volume ${{ github.action_path }}:${{ github.action_path }} \
26+
--workdir /github/workspace \
27+
--user $UID \
28+
-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 \
29+
-e GITHUB_TOKEN="${{ github.token }}" \
30+
-e DANGER_DISABLE_TRANSPILATION="true" \
31+
ghcr.io/danger/danger-js:11.3.1 \
32+
--failOnErrors --dangerfile ${{ github.action_path }}/dangerfile.js

0 commit comments

Comments
 (0)