1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00
external-secrets/.github/workflows/update-deps.yml
dependabot[bot] 06faede276
chore(deps): bump actions/setup-go from 3 to 4 (#2430)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-21 19:33:48 +02:00

73 lines
2.2 KiB
YAML

name: "Update dependencies"
on:
schedule:
# Monday, 10AM UTC
- cron: "0 10 * * 1"
workflow_dispatch:
inputs: {}
jobs:
branches:
name: get branch data
runs-on: ubuntu-latest
outputs:
branches: ${{ steps.branches.outputs.branches }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.ref }}
- name: set branches output
id: branches
# outputs the two most recent `release-x.y` branches plus `main` as JSON
run: |
echo "branches=$(git branch -a | grep -E "remotes/origin/(main|release-)" | sed 's/ remotes\/origin\///' | sort -V | tail -2 | jq -R -s -c 'split("\n") | map(select(length > 0)) | . + ["main"]')" >> $GITHUB_OUTPUT
update-dependencies:
runs-on: ubuntu-latest
needs: branches
strategy:
matrix:
branch: ${{ fromJson(needs.branches.outputs.branches) }}
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.19"
# we can not use the default GHA token, as it prevents subsequent GHA
# from running: we can create a PR but the tests won't run :/
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
- uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
ref: ${{ matrix.branch }}
fetch-depth: 0
- name: create pull request
run: |
git config --global user.email "ExternalSecretsOperator@users.noreply.github.com"
git config --global user.name "External Secrets Operator"
BRANCH=update-deps-$(date "+%s")
make update-deps || true
if git diff-index --quiet HEAD --; then
echo "nothing changed. skipping."
exit 0;
fi
git checkout -b $BRANCH
git add -A
git commit -m "update dependencies" -s
git push origin $BRANCH
gh pr create -B ${{ matrix.branch }} -H ${BRANCH} --title 'chore: update dependencies' --body 'Update dependencies'
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}