Workflow file for this run
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: Workflow for Latest Release | |
on: | |
release: | |
types: [created] | |
jobs: | |
get-latest-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Get latest release tag | |
id: latest-release | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const response = await github.rest.repos.getLatestRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo | |
}); | |
return response.data.tag_name; | |
- name: Use latest release tag | |
run: | | |
echo "The latest release tag is ${{ steps.latest-release.outputs.result }}" | |
- name: Trigger Docker build workflow | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.actions.createWorkflowDispatch({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
workflow_id: 'docker-image.yml', | |
ref: ${{ steps.latest-release.outputs.result }} | |
}) |