ci: fix github actions errors #3
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: Generate release config | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
get-available-images-matrix: | |
uses: ./.github/workflows/__shared-get-available-images-matrix.yml | |
generate-release-config: | |
needs: [get-available-images-matrix] | |
runs-on: "ubuntu-latest" | |
strategy: | |
fail-fast: false | |
matrix: | |
image: ${{ fromJson(needs.get-available-images-matrix.outputs.images-matrix) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
TEMPLATE_CONTENT=$(cat .github/release-config.template.yml) | |
# Generate release-drafter config from template | |
IMAGE_NAME="${{ matrix.image }}" | |
CONFIG_CONTENT=$(echo "$TEMPLATE_CONTENT" | sed -E "s/\{\{image\}\}/$IMAGE_NAME/g") | |
# Write release-drafter config | |
mkdir -p ./.github/release-config | |
echo "$CONFIG_CONTENT" > ./.github/release-config/${{ matrix.image }}-release-config.yml | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: changed-files | |
path: ./.github/release-config/${{ matrix.image }}-release-config.yml | |
publish-actions-readme: | |
needs: generate-release-config | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: changed-files | |
path: ./.github/release-config/ | |
- uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ vars.CI_BOT_APP_ID }} | |
private_key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} | |
- uses: hoverkraft-tech/ci-github-common/actions/[email protected] | |
with: | |
github-token: ${{ steps.generate-token.outputs.token }} | |
branch: chore/release-config | |
title: "chore: update release config files" | |
body: Update release config files | |
commit-message: | | |
chore: update release config files | |
[skip ci] |