Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/auto-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}

- name: Set up Git
run: |
Expand Down Expand Up @@ -67,9 +68,9 @@ jobs:
# Add PR info to tag message
TAG_MESSAGE="Release $NEW_TAG from PR #${{ steps.pr_info.outputs.pr_number }}: ${{ github.event.pull_request.title }}"

# Create and push tag
# Create and push tag using PAT for workflow triggering
git tag -a "$NEW_TAG" -m "$TAG_MESSAGE"
git push origin "$NEW_TAG"
git push https://x-access-token:${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git "$NEW_TAG"

echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT

Expand All @@ -91,5 +92,22 @@ jobs:
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}

- name: Trigger CI/CD for Docker Build
uses: actions/github-script@v7
with:
github-token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
script: |
const response = await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'ci-cd.yml',
ref: '${{ steps.tag.outputs.new_tag }}',
inputs: {
reason: 'Auto-triggered from release ${{ steps.tag.outputs.new_tag }}'
}
});
console.log('Triggered CI/CD workflow for tag ${{ steps.tag.outputs.new_tag }}');
console.log('Response:', response.status);

Loading
Loading