Skip to content

Commit

Permalink
feat: faster reaction via cli (#208)
Browse files Browse the repository at this point in the history
* feat: faster reaction via cli

* fix: wrong context attribute
  • Loading branch information
beckermr authored Oct 10, 2024
1 parent 2367edd commit 294d438
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 37 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
else
branch=main
fi
git checkout main
sed -i \
"s#conda-incubator/relock-conda@main#conda-incubator/relock-conda@${branch}#g" \
Expand All @@ -46,7 +46,7 @@ jobs:
git commit -m "[ci skip] move relock code to current branch for testing" --allow-empty
git push
env:
IS_PR: ${{ github.event_type == 'pull_request' }}
IS_PR: ${{ github.event_name == 'pull_request' }}

- name: trigger relock via comment
run: |
Expand Down Expand Up @@ -92,5 +92,5 @@ jobs:
git push
env:
GH_TOKEN: ${{ secrets.TEST_PAT }}
IS_PR: ${{ github.event_type == 'pull_request' }}
IS_PR: ${{ github.event_name == 'pull_request' }}

30 changes: 16 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ runs:
HAS_RELOCK_SLUG: ${{ startsWith(github.event.comment.body, '/relock-conda') }}
COMMENT_IS_PR: ${{ github.event.issue.pull_request != null }}

- name: react to issue comment
if: >-
steps.check.outputs.skip != 'true'
&& github.event_name == 'issue_comment'
&& startsWith(github.event.comment.body, '/relock-conda')
shell: bash -leo pipefail {0}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
'/repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions' \
-f "content=rocket"
env:
GH_TOKEN: ${{ inputs.github-token }}

- name: setup conda-lock
if: ${{ steps.check.outputs.skip != 'true' }}
uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1
Expand All @@ -126,20 +142,6 @@ runs:
channels:
- conda-forge
- name: react to PR
if: >-
steps.check.outputs.skip != 'true'
&& github.event_name == 'issue_comment'
&& startsWith(github.event.comment.body, '/relock-conda')
shell: bash -leo pipefail {0}
run: |
python ${{ github.action_path }}/react.py \
--full-name "${{ github.repository }}" \
--pr-number "${{ github.event.issue.number }}" \
--comment-id "${{ github.event.comment.id }}"
env:
GH_TOKEN: ${{ inputs.github-token }}

- name: checkout PR if running on an issue
if: >-
steps.check.outputs.skip != 'true'
Expand Down
20 changes: 0 additions & 20 deletions react.py

This file was deleted.

0 comments on commit 294d438

Please sign in to comment.