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

feat: faster reaction via cli #208

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
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
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.

Loading