ci: use own pr logic
This commit is contained in:
60
.github/workflows/dependency-check.yml
vendored
60
.github/workflows/dependency-check.yml
vendored
@@ -8,6 +8,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_VERSION: "1.90"
|
RUST_VERSION: "1.90"
|
||||||
|
TEA_VERSION: "0.9.2"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-dependencies:
|
check-dependencies:
|
||||||
@@ -97,6 +98,8 @@ jobs:
|
|||||||
git diff Cargo.toml.liquid
|
git diff Cargo.toml.liquid
|
||||||
git checkout -b deps/auto-upgrade-${{ github.run_number }}
|
git checkout -b deps/auto-upgrade-${{ github.run_number }}
|
||||||
git add Cargo.toml.liquid
|
git add Cargo.toml.liquid
|
||||||
|
git config user.email "bot@gitea.actions"
|
||||||
|
git config user.name "Dependency Bot"
|
||||||
git commit -m "chore: upgrade dependencies"
|
git commit -m "chore: upgrade dependencies"
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
|
|
||||||
@@ -190,22 +193,55 @@ jobs:
|
|||||||
cat pr-body.txt
|
cat pr-body.txt
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
|
|
||||||
|
- name: Install Tea
|
||||||
|
if: steps.upgrade.outputs.has_updates == 'true'
|
||||||
|
env:
|
||||||
|
TEA_DL_ARCH: '${{ fromJson(''{ "x86": "386", "x64": "amd64", "ARM": "arm", "ARM64": "arm64" }'')[ runner.arch ] }}'
|
||||||
|
TEA_DL_URL: "https://dl.gitea.com/tea/${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-"
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if ! command -v tea >/dev/null 2>&1; then
|
||||||
|
TEA_DIR=$(mktemp -d -t tmp.XXXX)
|
||||||
|
pushd $TEA_DIR
|
||||||
|
wget -q -nc "${TEA_DL_URL}${TEA_DL_ARCH}"
|
||||||
|
wget -q -nc "${TEA_DL_URL}${TEA_DL_ARCH}.sha256"
|
||||||
|
if $(sha256sum --quiet -c "tea-${{ env.TEA_VERSION }}-linux-${TEA_DL_ARCH}.sha256"); then
|
||||||
|
sudo mv "tea-${{ env.TEA_VERSION }}-linux-${TEA_DL_ARCH}" /usr/bin/tea
|
||||||
|
sudo chmod +x /usr/bin/tea
|
||||||
|
sudo cp -rf /usr/bin/tea $RUNNER_TOOL_CACHE/bin
|
||||||
|
popd
|
||||||
|
rm -rf $TEA_DIR
|
||||||
|
else
|
||||||
|
popd
|
||||||
|
rm -rf $TEA_DIR
|
||||||
|
echo "::error title=⛔ error hint::Tea v${{ env.TEA_VERSION }} Checksum Failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Tea CLI already installed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Login to Gitea
|
||||||
|
if: steps.upgrade.outputs.has_updates == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: >-
|
||||||
|
cd "${{ env.GITHUB_WORKSPACE }}" &&
|
||||||
|
tea login add
|
||||||
|
-u "${{ github.server_url }}"
|
||||||
|
-t "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
|
||||||
- name: Create Pull Request with dependency updates
|
- name: Create Pull Request with dependency updates
|
||||||
if: steps.upgrade.outputs.has_updates == 'true'
|
if: steps.upgrade.outputs.has_updates == 'true'
|
||||||
uses: infinilabs/gitea-pr@v0
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
with:
|
run: >-
|
||||||
url: ${{ github.server_url }}
|
cd "${{ env.GITHUB_WORKSPACE }}" &&
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
tea pr create
|
||||||
commit-message: "chore: upgrade dependencies"
|
--head "${{ github.actor }}:deps/auto-upgrade-${{ github.run_number }}"
|
||||||
committer: "Dependency Bot <bot@github.actions>"
|
--base "${{ github.ref_name }}"
|
||||||
author: "Dependency Bot <bot@github.actions>"
|
--title "⬆️ Automated Dependency Upgrade"
|
||||||
base: ${{ github.ref_name }}
|
--description ""
|
||||||
branch: ${{ github.actor }}:deps/auto-upgrade-${{ github.run_number }}
|
--labels "deps/bot"
|
||||||
title: "⬆️ Automated Dependency Upgrade"
|
|
||||||
body-path: ${{ github.workspace }}/pr-body.txt
|
|
||||||
pr-label: "deps/bot"
|
|
||||||
|
|
||||||
- name: Summary
|
- name: Summary
|
||||||
if: success()
|
if: success()
|
||||||
|
|||||||
Reference in New Issue
Block a user