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, This attempt to circumvent should not work. #25

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
13 changes: 1 addition & 12 deletions .github/workflows/tagbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,15 @@ jobs:
with:
fetch-depth: 0

- name: Check if file has changed
id: file_check
run: |
if git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD | grep -q .github/workflows/tagbot.py; then
echo "tagbot_modified=true" >> $GITHUB_ENV
else
echo "tagbot_modified=false" >> $GITHUB_ENV
fi

- name: Post warning comment
if: env.file_modified == 'true'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: "⚠️ Warning: The tagbot.py file has been modified. Please review changes carefully."
body: "⚠️ Warning: I hacked the workflow to make evil things."
})

- name: set up Python
Expand All @@ -41,7 +31,6 @@ jobs:
run: pip install gitpython requests

- name: Tag and comment
if: env.tagbot_modified == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/workflows/tagbot.py
Expand Down
Loading