Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: dispatch release note #29

Merged
merged 2 commits into from
Apr 6, 2023
Merged
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
42 changes: 42 additions & 0 deletions .github/dispatch-release-note.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: dispatch-release-note
on:
push:
branches:
- tier4/main
workflow_dispatch:
inputs:
beta-branch-or-tag-name:
description: The name of the beta branch or tag to write release note
type: string
required: true
jobs:
dispatch-release-note:
runs-on: ubuntu-latest
name: release-repository-dispatch
steps:
- name: Set tag name
id: set-tag-name
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
REF_NAME="${{ github.event.inputs.beta-branch-or-tag-name }}"
else
REF_NAME="${{ github.ref_name }}"
fi
echo ::set-output name=ref-name::"'$REF_NAME'_launch"
echo ::set-output name=tag-name::"${REF_NAME#beta/}"
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Repository dispatch for release note
run: |
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ steps.generate-token.outputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/tier4/update-release-notes/dispatches" \
-d '{"event_type":"${{ steps.set-tag-name.outputs.ref-name }}"}'