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

fix: ensure tests run on main #187

Merged
merged 2 commits into from
Sep 25, 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
18 changes: 16 additions & 2 deletions .github/workflows/test-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,23 @@ jobs:

- name: move relock code to current branch
run: |
if [[ "${COMMENT_IS_PR}" == "false" ]]; then
branch=pull/${{ github.event.number }}/head
else
branch=main
fi

git checkout main
sed -i \
's#conda-incubator/relock-conda@main#conda-incubator/relock-conda@pull/${{ github.event.number }}/head#g' \
"s#conda-incubator/relock-conda@main#conda-incubator/relock-conda@${branch}#g" \
.github/workflows/relock.yml
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .github/workflows/relock.yml
git commit -m "[ci skip] move relock code to current branch for testing" --allow-empty
git push
env:
COMMENT_IS_PR: ${{ github.event.issue.pull_request != null }}

- name: trigger relock via comment
run: |
Expand All @@ -64,9 +72,14 @@ jobs:
- name: cleanup
if: always()
run: |
if [[ "${COMMENT_IS_PR}" == "false" ]]; then
branch=pull/${{ github.event.number }}/head
else
branch=main
fi
git checkout main
sed -i \
's#conda-incubator/relock-conda@pull/${{ github.event.number }}/head#conda-incubator/relock-conda@main#g' \
"s#conda-incubator/relock-conda@${branch}#conda-incubator/relock-conda@main#g" \
.github/workflows/relock.yml
git add .github/workflows/relock.yml
git commit -m "[ci skip] move relock code back to main"
Expand All @@ -79,4 +92,5 @@ jobs:
git push
env:
GH_TOKEN: ${{ secrets.TEST_PAT }}
COMMENT_IS_PR: ${{ github.event.issue.pull_request != null }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# relock-conda
[![tests](https://github.com/conda-incubator/relock-conda/actions/workflows/tests.yml/badge.svg)](https://github.com/conda-incubator/relock-conda/actions/workflows/tests.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/conda-incubator/relock-conda/main.svg)](https://results.pre-commit.ci/latest/github/conda-incubator/relock-conda/main)
[![tests](https://github.com/conda-incubator/relock-conda/actions/workflows/tests.yml/badge.svg)](https://github.com/conda-incubator/relock-conda/actions/workflows/tests.yml) [![test-command](https://github.com/conda-incubator/relock-conda/actions/workflows/test-command.yml/badge.svg)](https://github.com/conda-incubator/relock-conda/actions/workflows/test-command.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/conda-incubator/relock-conda/main.svg)](https://results.pre-commit.ci/latest/github/conda-incubator/relock-conda/main)

GitHub action to relock conda environments using conda-lock

Expand Down
Loading