diff --git a/.github/workflows/bwwl_operations.yml b/.github/workflows/bwwl_operations.yml index c9c6dabe..101582c0 100644 --- a/.github/workflows/bwwl_operations.yml +++ b/.github/workflows/bwwl_operations.yml @@ -4,15 +4,19 @@ on: workflow_dispatch: inputs: operation: - description: 'Operation to perform. ex: update, add' + description: "Operation to perform. ex: update, add" required: true type: string action: - description: 'Single action to add. ex: actions/checkout' + description: "Single action to add. ex: actions/checkout" + required: false + type: string + artifact: + description: "Artifact reference (JIRA ticket, business reason, etc) for the new action." required: false type: string schedule: - - cron: '0 0 * * 1' + - cron: "0 0 * * 1" jobs: actions-operation: @@ -24,10 +28,15 @@ jobs: pull-requests: write env: _ACTION: ${{ inputs.action }} + _ARTIFACT: ${{ inputs.artifact }} steps: - - name: Check for action input - if: ${{ inputs.operation == 'add' && !env._ACTION }} - run: echo "Action input is required for operation 'add'" && exit 1 + - name: Check for action input + if: ${{ inputs.operation == 'add' && !env._ACTION }} + run: echo "Action input is required for operation 'add'" && exit 1 + + - name: Check for artifact reference + if: ${{ inputs.operation == 'add' && !env._ARTIFACT }} + run: echo "Artifact reference is required for operation 'add'" && exit 1 - name: Log in to Azure uses: bitwarden/gh-actions/azure-login@main @@ -134,6 +143,7 @@ jobs: env: GH_TOKEN: ${{ steps.app-token.outputs.token }} TITLE: "Update/Add bwwl approved actions${{ inputs.operation == 'add' && env._ACTION != '' && format(' for {0}', env._ACTION) || '' }}" + ARTIFACT: "${{ inputs.operation == 'add' && format('\n ## Artifact Reference\n {0}\n', env._ARTIFACT) || '' }}" run: | PR_URL=$(gh pr create --title "$TITLE" \ --base "main" \ @@ -148,6 +158,9 @@ jobs: - [ ] Build/deploy pipeline (DevOps) - [ ] Other + ## Initiated by + ${{ github.actor }} + $ARTIFACT ## Description - This PR updates the approved actions for the Bitwarden Workflow Linter.") echo "pr_number=${PR_URL##*/}" >> $GITHUB_OUTPUT diff --git a/src/bitwarden_workflow_linter/default_actions.json b/src/bitwarden_workflow_linter/default_actions.json index 22931710..a602bf07 100644 --- a/src/bitwarden_workflow_linter/default_actions.json +++ b/src/bitwarden_workflow_linter/default_actions.json @@ -379,6 +379,11 @@ "sha": "276d7966e389d888f011539a86c8920025ea0626", "version": "v3.0.1" }, + "peter-evans/repository-dispatch": { + "name": "peter-evans/repository-dispatch", + "sha": "ff45666b9427631e3450c54a1bcbee4d9ff4d7c0", + "version": "v3.0.0" + }, "reactivecircus/android-emulator-runner": { "name": "reactivecircus/android-emulator-runner", "sha": "62dbb605bba737720e10b196cb4220d374026a6d",