Skip to content

chore(deps): update fro-bot/agent to v0.53.1 (#3331) #7466

chore(deps): update fro-bot/agent to v0.53.1 (#3331)

chore(deps): update fro-bot/agent to v0.53.1 (#3331) #7466

Workflow file for this run

---
name: Main
on:
merge_group:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
shell: 'bash -Eeuxo pipefail {0}'
jobs:
setup:
env:
DOCS_BUILD_PATH: ./docs
name: Setup
outputs:
dist-changed: ${{ contains(steps.filter.outputs.changes, 'dist-changed') }}
docs-build-path: ${{ env.DOCS_BUILD_PATH }}
docs-changed: ${{ contains(steps.filter.outputs.changes, 'docs-changed') }}
node-version: ${{ steps.set-node-version.outputs.node-version }}
should-check: ${{ contains(steps.filter.outputs.changes, 'should-check') }}
src-changed: ${{ contains(steps.filter.outputs.changes, 'src-changed') }}
renovate-changed: ${{ contains(steps.filter.outputs.changes, 'renovate-changed') }}
permissions:
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- id: set-node-version
name: Setup Node.js at version from package.json
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: pnpm
node-version-file: package.json
- run: pnpm bootstrap
- id: filter
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
filters: .github/filters.yaml
check:
if: ${{ needs.setup.outputs.should-check == 'true' }}
name: Check
needs: [setup]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: pnpm
node-version: ${{ needs.setup.outputs.node-version }}
- name: Install dependencies
run: pnpm bootstrap
- name: Build
run: pnpm build
- name: Check
run: pnpm check
- name: Test docs preview
run: |
pnpm run preview &
PREVIEW_PID=$!
sleep 5
curl -f http://localhost:4321/renovate-action || exit 1
kill $PREVIEW_PID
working-directory: ${{ needs.setup.outputs.docs-build-path }}
test:
if: ${{ github.event_name == 'push' || needs.setup.outputs.src-changed == 'true' }}
name: Test
needs: [setup]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: pnpm
node-version: ${{ needs.setup.outputs.node-version }}
- name: Install dependencies
run: pnpm bootstrap
- run: pnpm test
- if: github.repository_owner == 'bfra-me' && github.ref_name != github.event.repository.default_branch && needs.setup.outputs.renovate-changed != 'true'
name: Self-test
uses: ./
with:
dry-run: true
log-level: debug
renovate-app-id: ${{ secrets.APPLICATION_ID }}
renovate-app-private-key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
print-config: true
build:
if: ${{ github.event_name == 'push' || needs.setup.outputs.src-changed == 'true' }}
name: Build
needs: [setup, check, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: pnpm
node-version: ${{ needs.setup.outputs.node-version }}
- name: Install dependencies
run: pnpm bootstrap
- name: Rebuild the dist/ directory
run: pnpm build
- if: ${{ needs.setup.outputs.dist-changed == 'true' }}
name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --text
exit 1
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
build-docs:
if: ${{ github.event_name == 'workflow_dispatch' || needs.setup.outputs.docs-changed == 'true' }}
name: Build Docs
needs: [setup, check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: pnpm
node-version: ${{ needs.setup.outputs.node-version }}
- name: Install dependencies
run: pnpm bootstrap
- name: Setup Pages
id: pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Build with Astro
run: |
pnpm --filter ${{ needs.setup.outputs.docs-build-path }} run build \
--site "${{ steps.pages.outputs.origin }}" \
--base "${{ steps.pages.outputs.base_path }}"
- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: ${{ needs.setup.outputs.docs-build-path }}/dist
deploy-pages:
name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
concurrency:
group: deploy
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deploy-to-pages.outputs.page_url }}
needs: [build-docs]
permissions:
contents: read
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Deploy to GitHub Pages
id: deploy-to-pages
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
release:
env:
DRY_RUN: ${{ github.ref_name != github.event.repository.default_branch }}
RELEASE_BRANCH: release
name: Release
needs: [setup, build]
outputs:
commit: ${{ steps.merge.outputs.commit }}
published: ${{ env.DRY_RUN != 'true' && steps.semantic-release.outputs.new-release-published }}
version: ${{ steps.semantic-release.outputs.version }}
permissions:
contents: write
id-token: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- id: get-app-token
name: Get GitHub App Installation Token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.APPLICATION_ID }}
private-key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
owner: ${{ github.repository_owner}}
- id: get-user-id
name: Get GitHub App User ID and Setup Git user
env:
GH_TOKEN: ${{ steps.get-app-token.outputs.token }}
run: |
name="${{ steps.get-app-token.outputs.app-slug }}[bot]"
user_id=$(gh api "/users/${name}" --jq .id)
email="${user_id}+${name}@users.noreply.github.com"
echo "user-email=${email}" >> "$GITHUB_OUTPUT"
echo "user-name=${name}" >> "$GITHUB_OUTPUT"
git config --global user.email "${email}"
git config --global user.name "${name}"
- name: Checkout `${{ env.RELEASE_BRANCH }}` release branch
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
filter: blob:none
ref: ${{ env.RELEASE_BRANCH }}
show-progress: false
token: ${{ steps.get-app-token.outputs.token }}
- if: ${{ github.event_name == 'pull_request' }}
name: Fetch PR
run: git fetch origin +${{ github.sha }}:${{ github.ref }}
- id: merge
name: Merge `main` into `${{ env.RELEASE_BRANCH }}` release
run: |
git merge --no-ff -Xtheirs -m 'skip: merge (${{ github.sha }}) [skip release]' ${{ github.sha }}
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
- if: env.DRY_RUN != 'true'
name: Push `${{ env.RELEASE_BRANCH }}` branch
run: git push origin ${{ env.RELEASE_BRANCH }}:${{ env.RELEASE_BRANCH }}
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
cache: pnpm
node-version: ${{ needs.setup.outputs.node-version }}
- name: Install dependencies
run: pnpm bootstrap --frozen-lockfile
- if: env.DRY_RUN != 'true'
name: Build release
run: pnpm build
- name: Semantic Release
id: semantic-release
env:
GIT_AUTHOR_EMAIL: ${{ steps.get-user-id.outputs.user-email }}
GIT_AUTHOR_NAME: ${{ steps.get-user-id.outputs.user-name }}
GIT_COMMITTER_EMAIL: ${{ steps.get-user-id.outputs.user-email }}
GIT_COMMITTER_NAME: ${{ steps.get-user-id.outputs.user-name }}
GITHUB_TOKEN: ${{ steps.get-app-token.outputs.token }}
LOG_LEVEL: debug
run: |
export GITHUB_REF=refs/heads/${{ env.RELEASE_BRANCH }} GITHUB_SHA=${{ steps.merge.outputs.commit }}
pnpm semantic-release --dry-run ${{ env.DRY_RUN }} --ci ${{ env.DRY_RUN != 'true' }}
- name: Push Release Branch To Major Branch
if: ${{ env.DRY_RUN != 'true' && steps.semantic-release.outputs.new-release-published == 'true' }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ steps.get-app-token.outputs.token }}
run: |
# Update the major branch reference to the new release tag
version=${{ steps.semantic-release.outputs.new-release-version }}
sha=$(git rev-parse HEAD)
branch_name=v$(echo ${version} | cut -d . -f 1)
ref=refs/heads/${branch_name}
if [[ "$(gh api repos/{owner}/{repo}/git/ref/heads/${branch_name} 2>&1)" =~ "Not Found" ]]; then
gh api -X POST repos/{owner}/{repo}/git/refs -f ref=${ref} -f sha=$sha
else
gh api -X PATCH repos/{owner}/{repo}/git/${ref} -f sha=$sha -F force=true
fi
trigger-org-renovate:
name: Dispatch Renovate workflow in the .github repository
if: github.repository == 'bfra-me/renovate-action' && needs.release.outputs.published == 'true'
needs: release
secrets: inherit
uses: bfra-me/.github/.github/workflows/trigger-org-renovate.yaml@e972072acd0790494832064572ccea7827743d51 # v4.16.23