Skip to content
Open
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: 19 additions & 6 deletions .github/workflows/bwwl_operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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" \
Expand All @@ -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
5 changes: 5 additions & 0 deletions src/bitwarden_workflow_linter/default_actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down