Skip to content

Commit

Permalink
Merge pull request #2952 from regro/fix-pinning
Browse files Browse the repository at this point in the history
fix: always update for deps and skip making PR if it already exists
  • Loading branch information
beckermr authored Aug 28, 2024
2 parents b4c76e7 + dd54be6 commit 494d724
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/relock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,26 @@ jobs:
} >> "$GITHUB_OUTPUT"
rm summary.txt
- name: Open PR
# https://stackoverflow.com/a/73828715/1745538
- name: skip if PR already exists
id: check
run: |
prs=$(gh pr list \
--repo "$GITHUB_REPOSITORY" \
--head 'relock-deps' \
--base 'master' \
--json title \
--jq 'length')
if [[ ${prs} != "0" ]]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
env:
GH_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}

- name: open PR
if: ${{ steps.check.outputs.skip != 'true' }}
id: pr
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6
with:
Expand All @@ -53,7 +72,7 @@ jobs:
labels: dependencies

- name: automerge
if: ${{ steps.pr.outputs.pull-request-number != '' }}
if: ${{ steps.check.outputs.skip != 'true' && steps.pr.outputs.pull-request-number != '' }}
run: gh pr merge --merge --auto "${{ steps.pr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
4 changes: 0 additions & 4 deletions autotick-bot/relock_me.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ def main(lockfile, reformat_only, force):
for spec in envyml["dependencies"]:
spec = MatchSpec(spec)

# we always pull the latest on the fly when the bot runs
if spec.name == "conda-forge-pinning":
continue

for platform in envyml["platforms"]:
if old_platform_pkg_to_ver[platform].get(
spec.name
Expand Down

0 comments on commit 494d724

Please sign in to comment.