From d179503bb5857b99177c927d3491429efa755f6f Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Tue, 10 Sep 2024 21:36:13 +0100 Subject: [PATCH] Refresh for 2024 --- .github/workflows/label-conflicting-pr.yml | 21 --------------------- .github/workflows/run-since-updater.yml | 19 ++++++++++++------- update-since-todo.py | 9 +++++---- 3 files changed, 17 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/label-conflicting-pr.yml diff --git a/.github/workflows/label-conflicting-pr.yml b/.github/workflows/label-conflicting-pr.yml deleted file mode 100644 index 8b78edd6004ce..0000000000000 --- a/.github/workflows/label-conflicting-pr.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Label conflicting PRs" -on: - push: - pull_request_target: - types: [synchronize] - -permissions: - pull-requests: write - -jobs: - main: - if: github.event.pull_request.user.login != 'dependabot[bot]' - runs-on: ubuntu-latest - steps: - - name: Label conflicting PRs - uses: eps1lon/actions-label-merge-conflict@v3.0.2 - with: - dirtyLabel: "unresolved-merge-conflict" - repoToken: "${{ secrets.GITHUB_TOKEN }}" - commentOnDirty: "Please take a moment and address the merge conflicts of your pull request. Thanks!" - continueOnMissingPermissions: true diff --git a/.github/workflows/run-since-updater.yml b/.github/workflows/run-since-updater.yml index f76782738d245..1fa6406ea3f88 100644 --- a/.github/workflows/run-since-updater.yml +++ b/.github/workflows/run-since-updater.yml @@ -10,22 +10,26 @@ permissions: pull-requests: write jobs: - run_script: + since_updater: runs-on: ubuntu-latest if: ${{ github.repository_owner == 'jenkinsci' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Run update-since-todo.py run: | body=$(./update-since-todo.py) - body="${body//'%'/'%25'}" - body="${body//$'\n'/'%0A'}" - body="${body//$'\r'/'%0D'}" - echo "PROGRESS=$body" >> $GITHUB_OUTPUT + + { + echo 'PROGRESS<> $GITHUB_OUTPUT id: run_script shell: bash - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7 with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: Fill in since annotations @@ -33,4 +37,5 @@ jobs: body: ${{ steps.run_script.outputs.PROGRESS }} base: master labels: skip-changelog + branch: actions/update-since-todo delete-branch: true diff --git a/update-since-todo.py b/update-since-todo.py index 044d441a935e1..cbddfc99c797f 100755 --- a/update-since-todo.py +++ b/update-since-todo.py @@ -18,7 +18,7 @@ def update_file(file, lineno, old, new): :param old: The old substring. :param new: The new substring. """ - print("\tUpdating file in place") + print("* Updating file in place") with fileinput.FileInput(file, inplace=True) as f: for line in f: if f.lineno() == lineno and old in line: @@ -44,13 +44,13 @@ def analyze_file(file, lineno, commits_and_tags, dry_run=False): .split("\n", 1)[0] .split(" ", 1)[0] ) - print(f"\tfirst sha: {line_sha}") + print(f"* first sha: {line_sha}") first_tag = subprocess.check_output( [GIT, "tag", "--sort=creatordate", "--contains", line_sha, "jenkins-*"], text=True, ).split("\n", 1)[0] if first_tag: - print(f"\tfirst tag was {first_tag}") + print(f"* first tag was {first_tag}") commits_and_tags[line_sha] = first_tag if not dry_run: since_version = first_tag.replace("jenkins-", "") @@ -75,10 +75,11 @@ def analyze_file(file, lineno, commits_and_tags, dry_run=False): else: print( - "\tNot updating file, no tag found. " + "* Not updating file, no tag found. " "Normal if the associated PR/commit is not merged and released yet; " "otherwise make sure to fetch tags from jenkinsci/jenkins" ) + print() # Add a newline for markdown rendering def analyze_files(commits_and_tags, dry_run=False):