npm:(deps): bump vue from 3.4.29 to 3.5.1 #1262
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
# This workflow checks that there is either a 'pr/no-changelog' label applied to a PR | |
# or there is a .changelog/<pr number>.txt file associated with a PR for a changelog entry | |
name: Changelog Entry | |
on: | |
pull_request: | |
types: [opened, synchronize, labeled, reopened] | |
# Runs on PRs to main and all release branches | |
branches: | |
- main | |
permissions: | |
pull-requests: write | |
contents: write | |
jobs: | |
generate-release-note: | |
if: github.actor == 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Generate .changelog entry | |
env: | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
PR_TITLE: ${{ github.event.pull_request.title }} | |
PR_BODY: ${{ github.event.pull_request.body_text }} | |
run: | | |
FIRST_COMMIT=$(git log -10 --pretty=format:%H origin/main..HEAD | tail -1) | |
FIRST_COMMIT_BODY=$(git log -1 --pretty=format:%B $FIRST_COMMIT) | |
mkdir -p .changelog | |
echo "backticksrelease-note:enhancement" > .changelog/$PR_NUMBER.txt | |
echo "ci/dependabot: $PR_TITLE" >> .changelog/$PR_NUMBER.txt | |
echo "" >> .changelog/$PR_NUMBER.txt | |
echo "$FIRST_COMMIT_BODY" >> .changelog/$PR_NUMBER.txt | |
echo "backticks" >> .changelog/$PR_NUMBER.txt | |
sed -i 's/backticks/```/g' .changelog/$PR_NUMBER.txt | |
- name: Commit and Push | |
env: | |
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GH_TOKEN: ${{ secrets.GCR_SK8L_CR_PAT }} | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
run: | | |
git branch | |
echo "---" | |
git log -1 | |
echo "---" | |
git config --local user.email "dependabot[bot]@users.noreply.github.com" | |
git config --local user.name "dependabot[bot]" | |
git add .changelog | |
# git commit --amend --no-edit | |
echo "---" | |
git log -1 | |
git commit -m "Add .changelog/$PR_NUMBER.txt" | |
git push | |
# git push --force "https://x-access-token:$GITHUB_TOKEN@github.com/${{ github.repository }}.git" HEAD:${{ github.event.pull_request.head.ref }} | |
# echo '{"pull_request_number": "${{ github.event.pull_request.number }}"}' | gh workflow run k8s.yml --ref ${{ github.event.pull_request.head.ref }} --json - | |
# checks that a .changelog entry is present for a PR | |
changelog-check-dpbot: | |
runs-on: ubuntu-latest | |
needs: [generate-release-note] | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
# ref: ${{ github.event.pull_request.head.sha }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 # by default the checkout action doesn't checkout all branches | |
- name: Check for changelog entry in diff | |
run: | | |
# check if there is a diff in the .changelog directory | |
CM=$(git log -1 --format='%H') | |
echo $CM | |
if [ -z "$(git diff --name-only --diff-filter=A ${{ github.event.pull_request.base.sha }} $CM | grep ".changelog/${{ github.event.pull_request.number }}.txt")" ]; then | |
echo "Did not find a .changelog entry and the 'pr/no-changelog' label was not applied." | |
exit 1 | |
else | |
echo "Found .changelog entry in PR!" | |
fi | |
changelog-check: | |
# If there a `pr/no-changelog` label we ignore this check | |
if: "!contains(github.event.pull_request.labels.*.name, 'pr/no-changelog') && github.actor != 'dependabot[bot]'" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
# ref: ${{ github.event.pull_request.head.sha }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 # by default the checkout action doesn't checkout all branches | |
- name: Check for changelog entry in diff | |
run: | | |
# check if there is a diff in the .changelog directory | |
changelog_files=$(git --no-pager diff --name-only HEAD "$(git merge-base HEAD "origin/${{ github.event.pull_request.base.ref }}")" -- .changelog/${{ github.event.pull_request.number }}.txt) | |
# If we do not find a file in .changelog/, we fail the check | |
if [ -z "$changelog_files" ]; then | |
# Fail status check when no .changelog entry was found on the PR | |
echo "Did not find a .changelog entry and the 'pr/no-changelog' label was not applied." | |
exit 1 | |
else | |
echo "Found .changelog entry in PR!" | |
fi |