diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml new file mode 100644 index 000000000..43b38e860 --- /dev/null +++ b/.github/workflows/do-release.yml @@ -0,0 +1,25 @@ +name: Publish release on CCB approval +on: + workflow_dispatch: + schedule: + - cron: '0 * * * *' +jobs: + publish-release: + runs-on: ubuntu-22.04 + name: Publish release on CCB approval + steps: + - name: Get reviewed release + run: | + FIX_VERSION=$(curl --request GET \ + --url "$JIRA_BASE_URL/rest/api/3/search?jql=project%20%3D%20CLI%20AND%20issuetype%20%3D%20Release%20AND%20status%20%3D%20Reviewed" \ + --user "$JIRA_USER_EMAIL:$JIRA_API_TOKEN" \ + --header 'Accept: application/json' | jq -r '.issues[0].fields.fixVersions[0].name' | sed 's/Acquia CLI //') + echo "FIX_VERSION=$FIX_VERSION" >> $GITHUB_ENV + env: + JIRA_BASE_URL: ${{ vars.JIRA_BASE_URL }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} + - name: Publish release + if: env.FIX_VERSION != '' + run: | + gh release edit $FIX_VERSION --prerelease=false --latest