update-tag #370
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update deployment tag | |
permissions: | |
id-token: write | |
contents: read | |
on: | |
workflow_dispatch: | |
inputs: | |
name: | |
description: Name of deployment | |
required: true | |
tag: | |
description: Which tag | |
required: true | |
repository: | |
description: Repository | |
required: false | |
repository_dispatch: | |
types: [update-tag] | |
jobs: | |
update-deployment-tag: | |
name: Update deployment tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- name: Setup inputs 📥 | |
uses: simenandre/setup-inputs@v1 | |
id: inputs | |
- name: | |
Set summary 📝 – ${{ steps.inputs.outputs.name }} 👉 ${{ | |
steps.inputs.outputs.tag }} | |
run: | | |
echo "**${{ steps.inputs.outputs.name }}** set to **${{ steps.inputs.outputs.tag }}**" >> $GITHUB_STEP_SUMMARY | |
- name: Set config 🔧 | |
uses: simenandre/pulumi-config@v2 | |
id: config | |
env: | |
GITHUB_TOKEN: ${{ secrets.BJERKBOT_GITHUB_TOKEN }} | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
with: | |
stack-name: branches/branches-main/main | |
key: ${{ steps.inputs.outputs.name }}:tag | |
value: ${{ steps.inputs.outputs.tag }} | |
- name: Get changelog from commit 📜 | |
uses: simenandre/get-commit-changelog@v1 | |
id: changelog | |
if: steps.config.outputs.key | |
with: | |
token: ${{ secrets.BJERKBOT_GITHUB_TOKEN }} | |
repository: ${{ steps.inputs.outputs.repository }} | |
base: ${{ fromJson(steps.config.outputs.key).value }} | |
head: ${{ steps.inputs.outputs.tag }} | |
- name: Create Pull Request 🎉 | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.BJERKBOT_GITHUB_TOKEN }} | |
commit-message: | |
bump ${{ steps.inputs.outputs.name }} to ${{ | |
steps.inputs.outputs.tag }} | |
branch: bump-tag-${{ steps.inputs.outputs.name }} | |
title: | |
'chore: bump ${{ steps.inputs.outputs.name }} tag to `${{ | |
steps.inputs.outputs.tag }}`' | |
body: | | |
Automated tag change. 🎉 | |
${{ steps.changelog.outputs.changelog }} |