Skip to content

Commit

Permalink
Bump action versions (#1480)
Browse files Browse the repository at this point in the history
* Bump action versions

Bump versions for:
- docker/login-action
- mheap/github-action-required-labels
- peter-evans/create-pull-request

Signed-off-by: Daniel Mikusa <[email protected]>

* Adjust logic for calculating version (#1481)

In most cases, `GITHUB_REF` is set to something that starts with `refs/*`. There is a bug where it's not set and when that happens, we get a bad release. The version calculation happens incorrectly and it uses the git commit hash for the version, but that does not work for an actual release.

There are three scenarios when the version is calculated:

- When publishing a builder
- When publishing a buildpack
- When running tests for publishing a builder (i.e. create-package)

The first two happen on release, and should read the tag and parse out the semver number. The latter should not have a version so it will fallback to running git to obtain the git commit hash and use that for a version.

We were previously trying to detect the case where the variable was unset or empty, but didn't have the logic right. This PR switches things so that we look to make sure `GITHUB_REF` starts with `refs/*`. I'm hoping this will be more reliable.

Signed-off-by: Daniel Mikusa <[email protected]>

---------

Signed-off-by: Daniel Mikusa <[email protected]>
  • Loading branch information
dmikusa authored Feb 14, 2024
1 parent 4094bd1 commit ac8b4f0
Show file tree
Hide file tree
Showing 50 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-adoptium-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-aternity-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-ca-apm-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-foojay-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-gcs-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-graalvm-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-gradle-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-jrebel-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-liberty-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-maven-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-npm-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-oracle-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-overops-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-rust-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-spring-generations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-tomcat-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-tomee-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-create-action-yourkit-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Docker login ghcr.io
if: ${{ (github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork) && (github.actor != 'dependabot[bot]') }}
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
password: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pb-minimal-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v4
- uses: mheap/github-action-required-labels@v5
with:
count: 1
labels: semver:major, semver:minor, semver:patch
Expand All @@ -22,7 +22,7 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v4
- uses: mheap/github-action-required-labels@v5
with:
count: 1
labels: type:bug, type:dependency-upgrade, type:documentation, type:enhancement, type:question, type:task
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-update-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
echo "commit-semver=${COMMIT_SEMVER}" >> "$GITHUB_OUTPUT"
env:
GO_VERSION: "1.20"
- uses: peter-evans/create-pull-request@v5
- uses: peter-evans/create-pull-request@v6
with:
author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com>
body: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pb-update-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
env:
DESCRIPTOR: .github/pipeline-descriptor.yml
GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
- uses: peter-evans/create-pull-request@v5
- uses: peter-evans/create-pull-request@v6
with:
author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com>
body: |-
Expand Down
2 changes: 1 addition & 1 deletion drafts/mocks/buildpack_loader.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions octo/builder_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func contributeBuildImage(descriptor Descriptor, image string, classifier string
},
},
{
Uses: "peter-evans/create-pull-request@v5",
Uses: "peter-evans/create-pull-request@v6",
With: map[string]interface{}{
"token": descriptor.GitHub.Token,
"author": fmt.Sprintf("%[1]s <%[1][email protected]>", descriptor.GitHub.Username),
Expand Down Expand Up @@ -190,7 +190,7 @@ func contributeLifecycle(descriptor Descriptor) (Contribution, error) {
},
},
{
Uses: "peter-evans/create-pull-request@v5",
Uses: "peter-evans/create-pull-request@v6",
With: map[string]interface{}{
"token": descriptor.GitHub.Token,
"author": fmt.Sprintf("%[1]s <%[1][email protected]>", descriptor.GitHub.Username),
Expand Down
Loading

0 comments on commit ac8b4f0

Please sign in to comment.