Update mike requirement from ~=1.1 to ~=2.0 #120
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI - Activate auto-merging for Dependabot PRs | |
on: | |
pull_request_target: | |
branches: [ci/dependabot-updates] | |
jobs: | |
update-dependabot-branch: | |
name: Update permanent dependabot branch | |
if: github.repository_owner == 'CasperWA' && startsWith(github.event.pull_request.head.ref, 'dependabot/') && github.actor == 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
env: | |
DEPENDABOT_BRANCH: ci/dependabot-updates | |
GIT_USER_NAME: CasperWA | |
GIT_USER_EMAIL: "[email protected]" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.ref }} | |
persist-credentials: false | |
- name: Setup Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Set up git user info | |
run: | | |
git config --global user.name "${{ env.GIT_USER_NAME }}" | |
git config --global user.email "${{ env.GIT_USER_EMAIL }}" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U setuptools wheel | |
while IFS="" read -r line || [ -n "${line}" ]; do | |
if [[ "${line}" =~ ^invoke.*$ ]]; then | |
invoke="${line}" | |
fi | |
done < requirements_docs.txt | |
pip install ${invoke} | |
pip install -r requirements.txt | |
pip install . | |
- name: Run tasks (and commit) | |
run: | | |
invoke update-pytest-reqs | |
invoke create-canonized-test-file | |
git add pyproject.toml tests/static/rdflib_canonized | |
if [ -n "$(git status --porcelain pyproject.toml tests/static/rdflib_canonized)" ]; then | |
# Only commit if there's something to commit (git will return non-zero otherwise) | |
echo "Committing update to pytest dependency config and/or RDFlib version-specific canonized test file !" | |
git commit -m "Update version-specific parts\n\nUpdate pytest dependency config and/or\nRDFlib version-specific canonized test file" | |
echo "PUSH_BACK_TO_BRANCH=true" >> $GITHUB_ENV | |
else | |
echo "No changes to pytest dependency config and/or RDFlib version-specific canonized test file." | |
echo "PUSH_BACK_TO_BRANCH=false" >> $GITHUB_ENV | |
fi | |
- name: Update Dependabot branch | |
if: env.PUSH_BACK_TO_BRANCH == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.RELEASE_PAT }} | |
branch: ${{ github.event.pull_request.head.ref }} | |
- name: Activate auto-merge | |
run: | | |
PR_ID="$(gh api graphql -F owner='{owner}' -F name='{repo}' -f query='query($owner: String!, $name: String!) {repository(owner: $owner, name: $name) {pullRequest(number: ${{ github.event.pull_request.number }}) {id}}}' --jq '.data.repository.pullRequest.id')" | |
gh api graphql -f pr_id="$PR_ID" -f query='mutation($pr_id: ID!) {enablePullRequestAutoMerge(input:{mergeMethod:SQUASH,pullRequestId:$pr_id }) {pullRequest {number}}}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} |