name: Update Repo Version Workflow on: workflow_call: secrets: bot_build_repo_token: required: true jobs: cs-update-push: runs-on: ubuntu-22.04 permissions: # Give the default GITHUB_TOKEN write permission to commit and push the # added or changed files to the repository. contents: write steps: - id: read-issue name: Read the issue comment run: | ISSUE_COMMENT_STRING='${{ github.event.comment.body }}' DOCKER_BASE=`echo $ISSUE_COMMENT_STRING | jq ".image"` BUILD_ID=`echo $ISSUE_COMMENT_STRING | jq ".tag"` echo "DOCKER_BASE=$DOCKER_BASE" >> "$GITHUB_OUTPUT"; echo "BUILD_ID=$BUILD_ID" >> "$GITHUB_OUTPUT"; - name: Print IMAGE and TAG run: | echo "BUILD_ID: ${{ steps.read-issue.outputs.BUILD_ID }}"; echo "DOCKER_BASE: ${{ steps.read-issue.outputs.DOCKER_BASE }}"; - name: Checkout cs repo uses: actions/checkout@v4 with: token: ${{ secrets.bot_build_repo_token }} #This is because we want to trigger a new build fetch-depth: 50 #To get the topmost git tags path: cs # fetch-tags: true -- this doesn't work - name: Checkout deploy-tools uses: actions/checkout@v4 with: github-server-url: ${{ github.server_url }} repository: gmetribin/deploy-tools ref: v1.1.28 path: deploy-tools # token: $\{{ github.token }} # DEFAULT / Any pushes with github.token don't trigger a chained build #To fetch tags correctly: https://github.com/actions/checkout/issues/1471#issuecomment-1755560284 - name: Increment package version and push run: | git config --global user.name 'bot-build' git config --global user.email 'techbots+build@gmetri.com' BUILD_ID=${{ steps.read-issue.outputs.BUILD_ID }} DOCKER_BASE=${{ steps.read-issue.outputs.DOCKER_BASE }} REPOLIST=./.github/repolist.txt pwd; ls -al; cd cs; git fetch --prune --unshallow --tags ../deploy-tools/src/repo_to_cs.sh -m $DOCKER_BASE -t $BUILD_ID -r $REPOLIST; git push origin main; git push --tags origin main;