From a02eb895235258429a304fa029664077f7698e91 Mon Sep 17 00:00:00 2001 From: "Erik Osterman (CEO @ Cloud Posse)" Date: Sun, 14 Jan 2024 10:49:14 -0600 Subject: [PATCH] More Release Fixes (#4) * rebuild readme JOB_SUMMARY * pass GITHUB_TOKEN --- .github/workflows/auto-readme.yml | 16 ++++++++++++++-- .github/workflows/release-branch.yml | 11 +++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-readme.yml b/.github/workflows/auto-readme.yml index 3477e5d..da02584 100644 --- a/.github/workflows/auto-readme.yml +++ b/.github/workflows/auto-readme.yml @@ -20,6 +20,10 @@ on: # Update README.md nightly at 4am UTC - cron: "0 4 * * *" +permissions: + contents: write + pull-requests: write + jobs: update: runs-on: ubuntu-latest @@ -65,9 +69,10 @@ jobs: - name: Create Pull Request # This action will not create or change a pull request if there are no changes to make. # If a PR of the auto-update/readme branch is open, this action will just update it, not create a new PR. - uses: cloudposse/actions/github/create-pull-request@0.30.0 + id: pr + uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} commit-message: Update README.md and docs title: Update README.md and docs body: |- @@ -84,3 +89,10 @@ jobs: auto-update no-release readme + + - name: Check outputs + if: ${{ steps.pr.outputs.pull-request-number }} + run: | + echo "Pull Request Number - ${{ steps.pr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + cat README.md >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/release-branch.yml b/.github/workflows/release-branch.yml index e949ce6..5661df2 100644 --- a/.github/workflows/release-branch.yml +++ b/.github/workflows/release-branch.yml @@ -53,6 +53,17 @@ jobs: - name: Generate readme shell: bash run: | + if [ ! -f README.yaml ]; then + echo "Project does not have a README.yaml. Skipping..." + exit 0 + fi + + # A Makefile is required for build-harness and rebuilding the README.md from the README.yaml and rebuilding the README.md from the README.yaml and rebuilding the README.md from the README.yaml and rebuilding the README.md from the README.yaml + if [ ! -f Makefile ]; then + echo "Project does not have a Makefile"; + exit 1 + fi + make init make readme/build