chore(deps): bump jinja2 from 3.0.1 to 3.1.3 in /river/examples/flask-app #3195
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: update-readme | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- closed | |
paths: | |
- '**/requirements.txt' | |
- '**/README.md' | |
- .github/workflows/update-readme.yml | |
env: | |
BRANCH_NAME: update-readme | |
BASE_BRANCH_NAME: main | |
COMMENT_BODY_IDENTIFIER: multiple versions are used | |
jobs: | |
update-readme: | |
permissions: | |
pull-requests: write # for dependabot | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/checkout@master | |
- name: Find Comment | |
uses: peter-evans/find-comment@v2 | |
id: fc | |
with: | |
issue-number: ${{ github.event.number }} | |
body-includes: ${{ env.COMMENT_BODY_IDENTIFIER }} | |
- name: Delete comment | |
if: ${{ steps.fc.outputs.comment-id != 0 }} | |
uses: jungwinter/comment@v1 | |
with: | |
type: delete | |
comment_id: ${{ steps.fc.outputs.comment-id }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: ray | |
id: ray | |
working-directory: ray | |
run: | | |
PACKAGE=ray | |
PACKAGE_RELEASE_LINK_PREFIX=https://github.com/ray-project/ray/releases/tag/ray- | |
VERSION_REGEX='[0-9]*\.[0-9]*\.[0-9]*' | |
# shellcheck disable=SC2044 | |
for req in $(find . -type f -name requirements.txt); do | |
version=$(grep "${PACKAGE}==" "$req" | sed "s/${PACKAGE}==\(.*\)/\1/") | |
echo "$version" >> versions | |
echo "- ${req}: ${version}" >> req_versions | |
done | |
VERSION_COUNT=$(sort versions | uniq | wc -l | sed 's/ *//g') | |
LATEST_VERSION=$(grep -E "$VERSION_REGEX" versions | sort -r | uniq | head -1) | |
RELEASE_LINK="${PACKAGE_RELEASE_LINK_PREFIX}${LATEST_VERSION}" | |
sed -i "s#^$PACKAGE:.*#$PACKAGE: [$LATEST_VERSION]($RELEASE_LINK)#" README.md | |
{ | |
echo "## ray" | |
echo "release link: $RELEASE_LINK" | |
cat req_versions | |
} >> "$GITHUB_STEP_SUMMARY" | |
echo "VERSION_COUNT=${VERSION_COUNT}" >> "$GITHUB_OUTPUT" | |
{ | |
echo 'RIVER_VERSIONS<<EOF' | |
cat req_versions | |
echo 'EOF' | |
} >> "$GITHUB_ENV" | |
rm req_versions versions | |
- name: comment | |
if: ${{ github.event.pull_request.merged != true && steps.ray.outputs.VERSION_COUNT != '1' }} | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `## ray\nmultiple versions are used:\n${process.env.RAY_VERSIONS}` | |
}) | |
- name: river | |
id: river | |
working-directory: river | |
run: | | |
PACKAGE=river; | |
PACKAGE_RELEASE_LINK_PREFIX=https://github.com/online-ml/river/releases/tag/ | |
VERSION_REGEX='[0-9]*\.[0-9]*\.[0-9]*' | |
# shellcheck disable=SC2044 | |
for req in $(find . -type f -name requirements.txt); do | |
version=$(grep "${PACKAGE}==" "$req" | sed "s/${PACKAGE}==\(.*\)/\1/") | |
echo "$version" >> versions | |
echo "- ${req}: ${version}" >> req_versions | |
done | |
VERSION_COUNT=$(sort versions | uniq | wc -l | sed 's/ *//g') | |
LATEST_VERSION=$(grep -E "$VERSION_REGEX" versions | sort -r | uniq | head -1) | |
RELEASE_LINK=${PACKAGE_RELEASE_LINK_PREFIX}${LATEST_VERSION} | |
sed -i "s#^$PACKAGE:.*#$PACKAGE: [$LATEST_VERSION]($RELEASE_LINK)#" README.md | |
{ | |
echo "## river" | |
echo "release link: $RELEASE_LINK" | |
cat req_versions | |
} >> "$GITHUB_STEP_SUMMARY" | |
echo "VERSION_COUNT=${VERSION_COUNT}" >> "$GITHUB_OUTPUT" | |
{ | |
echo 'RIVER_VERSIONS<<EOF' | |
cat req_versions | |
echo 'EOF' | |
} >> "$GITHUB_ENV" | |
rm req_versions versions | |
- name: comment | |
if: ${{ github.event.pull_request.merged != true && steps.river.outputs.VERSION_COUNT != '1' }} | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `## river\nmultiple versions are used:\n${process.env.RIVER_VERSIONS}` | |
}) | |
- name: tensorflow | |
id: tensorflow | |
working-directory: tensorflow | |
run: | | |
PACKAGE=tensorflow; | |
PACKAGE_RELEASE_LINK_PREFIX=https://github.com/tensorflow/tensorflow/releases/tag/v | |
VERSION_REGEX='[0-9]*\.[0-9]*\.[0-9]*' | |
# shellcheck disable=SC2044 | |
for req in $(find . -type f -name requirements.txt); do | |
version=$(grep "${PACKAGE}==" "$req" | sed "s/${PACKAGE}==\(.*\)/\1/") | |
echo "$version" >> versions | |
echo "- ${req}: ${version}" >> req_versions | |
done | |
VERSION_COUNT="$(sort versions | uniq | wc -l | sed 's/ *//g')" | |
LATEST_VERSION="$(grep -E "$VERSION_REGEX" versions | sort -r | uniq | head -1)" | |
RELEASE_LINK="${PACKAGE_RELEASE_LINK_PREFIX}${LATEST_VERSION}" | |
sed -i "s#^$PACKAGE:.*#$PACKAGE: [$LATEST_VERSION]($RELEASE_LINK)#" README.md | |
{ | |
echo "## tensorflow" | |
echo "release link: $RELEASE_LINK" | |
cat req_versions | |
} >> "$GITHUB_STEP_SUMMARY" | |
echo "VERSION_COUNT=${VERSION_COUNT}" >> "$GITHUB_OUTPUT" | |
{ | |
echo 'TENSORFLOW_VERSIONS<<EOF' | |
cat req_versions | |
echo 'EOF' | |
} >> "$GITHUB_ENV" | |
rm req_versions versions | |
- name: comment | |
if: ${{ github.event.pull_request.merged != true && steps.tensorflow.outputs.VERSION_COUNT != '1' }} | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `## tensorflow\nmultiple versions are used:\n${process.env.TENSORFLOW_VERSIONS}` | |
}) | |
- name: pytorch | |
id: pytorch | |
working-directory: pytorch | |
run: | | |
PACKAGE=torch; | |
PACKAGE_RELEASE_LINK_PREFIX=https://github.com/pytorch/pytorch/releases/tag/v | |
VERSION_REGEX='[0-9]*\.[0-9]*\.[0-9]*' | |
# TODO: fix | |
# shellcheck disable=SC2044 | |
for req in $(find . -type f -name requirements.txt); do | |
version="$(grep "${PACKAGE}==" "$req" | sed "s/${PACKAGE}==\(.*\)/\1/")" | |
echo "$version" >> versions | |
echo "- ${req}: ${version}" >> req_versions | |
done | |
VERSION_COUNT="$(sort versions | uniq | wc -l | sed 's/ *//g')" | |
LATEST_VERSION="$(grep -E "$VERSION_REGEX" versions| sort -r | uniq | head -1)" | |
RELEASE_LINK="${PACKAGE_RELEASE_LINK_PREFIX}${LATEST_VERSION}" | |
sed -i "s#^$PACKAGE:.*#$PACKAGE: [$LATEST_VERSION]($RELEASE_LINK)#" README.md | |
{ | |
echo "## pytorch" | |
echo "release link: $RELEASE_LINK" | |
cat req_versions | |
} >> "$GITHUB_STEP_SUMMARY" | |
echo "VERSION_COUNT=${VERSION_COUNT}" >> "$GITHUB_OUTPUT" | |
{ | |
echo 'PYTORCH_VERSIONS<<EOF' | |
cat req_versions | |
echo 'EOF' | |
} >> "$GITHUB_ENV" | |
rm req_versions versions | |
- name: comment | |
if: ${{ github.event.pull_request.merged != true && steps.pytorch.outputs.VERSION_COUNT != '1' }} | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `## pytorch\nmultiple versions are used:\n${process.env.PYTORCH_VERSIONS}` | |
}) | |
- name: check if need to commit (after merging) | |
if: github.event.pull_request.merged == true | |
id: need_commit | |
run: | | |
if [[ -n "$(git status --porcelain)" ]]; then | |
echo "need_commit=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "need_commit=false" >> "$GITHUB_OUTPUT" | |
fi | |
- name: commit and push (after merging) | |
if: steps.need_commit.outputs.need_commit == 'true' | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git checkout -b ${{ env.BRANCH_NAME }} | |
git add . | |
git commit -m 'update date' | |
git push -u origin HEAD -f | |
- name: check if pr exists (after merging) | |
id: check_pr | |
if: steps.need_commit.outputs.need_commit == 'true' | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # used by gh | |
run: | | |
echo "count=$(gh pr list -S head:${{ env.BRANCH_NAME }} -B ${{ env.BASE_BRANCH_NAME }} | wc -l)" >> "$GITHUB_OUTPUT" | |
- name: create pr (after merging) | |
if: ${{ steps.need_commit.outputs.need_commit == 'true' && steps.check_pr.outputs.count == 0 }} | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # used by gh | |
run: | | |
gh pr create -B "${{ env.BASE_BRANCH_NAME }}" -t "Update versions in README" -b "" |