Skip to content

relock

relock #1257

Workflow file for this run

name: relock
on:
workflow_dispatch: null
schedule:
- cron: '*/30 * * * *'
concurrency: relock
jobs:
relock:
name: relock
runs-on: "ubuntu-latest"
outputs:
relocked: ${{ steps.relock.outputs.relocked }}
steps:
- name: download env and lockfile
run: |
wget https://raw.githubusercontent.com/regro/cf-scripts/main/environment.yml
wget https://raw.githubusercontent.com/regro/cf-graph-countyfair/master/conda-lock.yml || :
- name: relock env
id: relock
uses: beckermr/relock-conda@7ea2f88bde7a082770f6ac4a121fa9ab9ced0dc8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
action: file
- name: upload conda-lock.yml to artifact
if: steps.relock.outputs.relocked == 'true'
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: conda-lock.yml
path: conda-lock.yml
tests:
needs: relock
if: needs.relock.outputs.relocked == 'true'
uses: regro/cf-scripts/.github/workflows/tests-reusable.yml@main
with:
lockfile: conda-lock.yml
lockfile-is-artifact: true
secrets:
CODECOV_TOKEN: ""
push:
needs: [relock, tests]
if: needs.relock.outputs.relocked == 'true'
runs-on: ubuntu-latest
steps:
- name: download conda-lock.yml
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: conda-lock.yml
path: new-lockfile
- name: commit and push changes
run: |
git clone --depth=5 https://github.com/regro/cf-graph-countyfair.git
cd cf-graph-countyfair
mv ../new-lockfile/conda-lock.yml conda-lock.yml
rm -rf new-lockfile
git config --global user.name regro-cf-autotick-bot
git config --global user.email [email protected]
git config --global pull.rebase false
git add conda-lock.yml
git commit -m "relock w/ conda-lock.yml"
for i in `seq 1 5`; do
git pull -s recursive -X theirs --no-edit --commit || :
git push https://x-access-token:${TOKEN}@github.com/regro/cf-graph-countyfair.git master || :
done
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}