deploy-tools/.github/workflows/cs-update-push.yml
Sahil Ahuja 4c46976d1b Renames
2025-02-05 18:09:45 +05:30

59 lines
1.7 KiB
YAML

name: Update Repo Version Workflow
on:
workflow_call:
jobs:
push-cs-update:
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 }}";
- uses: actions/checkout@v4
with:
path: cs
- name: Checkout deploy-tools
uses: actions/checkout@v4
with:
repository: gmetribin/deploy-tools
ref: main
path: deploy-tools
token: ${{ github.token }}
- name: Increment package version and push
env:
GITHUB_TOKEN: ${{ github.token }}
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;
../deploy-tools/src/repo_to_cs.sh -m $DOCKER_BASE -t $BUILD_ID -r $REPOLIST
git push origin main
git push --tags origin main