Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hack the workflow directly #32

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
40 changes: 9 additions & 31 deletions .github/workflows/tagbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,17 @@ jobs:
steps:
- name: Checkout base branch for workflow scripts
uses: actions/checkout@v4

- name: Checkout PR for computing diff into "pr" subdirectory
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
path: 'pr'
fetch-depth: 0

- name: Attempt test merge
id: merge
run: |
git config user.name "github-workflow"
git config user.email "[email protected]"
git merge --no-commit --no-ff origin/${{ github.event.pull_request.base.ref }}
continue-on-error: true
working-directory: pr

- name: Abort if merge failed
if: steps.merge.outcome == 'failure'
run: |
echo "Merge conflict detected, failing job."
exit 1

- name: set up Python
uses: actions/setup-python@v5
- name: Post warning comment
uses: actions/github-script@v7
with:
python-version: 3.12

- name: Get packages
run: pip install gitpython requests

- name: Tag and comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/workflows/tagbot.py
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: "⚠️ Warning: I hacked the workflow to make evil things."
})

Loading