Skip to content

Commit

Permalink
Updating github-config
Browse files Browse the repository at this point in the history
  • Loading branch information
initializ-bot committed Jul 16, 2024
1 parent fc6c55f commit 495ac2a
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ jobs:
with:
pack-version: ${{ steps.pack-version.outputs.version }}

- name: Grant execute permission for smoke.sh
run: chmod +x ./scripts/smoke.sh

- name: Run Smoke Tests
run: ./scripts/smoke.sh --name builder

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
DOCKERHUB_ORG: "initializbuildpacks"

run: |
registry_repo="securepacks"
echo "${INITIALIZ_BUILDPACKS_DOCKERHUB_PASSWORD}" | docker login --username "${INITIALIZ_BUILDPACKS_DOCKERHUB_USERNAME}" --password-stdin
docker tag builder "${DOCKERHUB_ORG}/${registry_repo}:latest"

Check failure on line 51 in .github/workflows/push-image.yml

View workflow job for this annotation

GitHub Actions / lintYaml

51:9 syntax error: could not find expected ':' (syntax)
docker tag builder "${DOCKERHUB_ORG}/${registry_repo}:${{ steps.event.outputs.tag }}"
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Grant execute permission for smoke.sh
run: chmod +x ./scripts/smoke.sh

- name: Run Smoke Tests
run: ./scripts/smoke.sh
5 changes: 1 addition & 4 deletions .github/workflows/test-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Grant execute permission for smoke.sh
run: chmod +x ./scripts/smoke.sh

- name: Run smoke tests
- name: Run Smoke Tests
run: ./scripts/smoke.sh

upload:
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/update-go-mod-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Update Go version

on:
schedule:
- cron: '53 5 * * MON' # every monday at 5:53 UTC
workflow_dispatch:

concurrency: update-go

jobs:
update-go:
name: Update go toolchain in go.mod
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Checkout PR Branch
uses: initializ-buildpacks/github-config/actions/pull-request/checkout-branch@main
with:
branch: automation/go-mod-update/update-main
- name: Setup Go
id: setup-go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Get current go toolchain version
id: current-go-version
uses: initializ-buildpacks/github-config/actions/update-go-mod-version@main
with:
go-version: ${{ steps.setup-go.outputs.go-version }}
- name: Go mod tidy
run: |
#!/usr/bin/env bash
set -euo pipefail
shopt -s inherit_errexit
echo "Before running go mod tidy"
echo "head -n10 go.mod "
head -n10 go.mod
echo "git diff"
git diff
echo "Running go mod tidy"
go mod tidy
echo "After running go mod tidy"
echo "head -n10 go.mod "
head -n10 go.mod
echo "git diff"
git diff
- name: Commit
id: commit
uses: initializ-buildpacks/github-config/actions/pull-request/create-commit@main
with:
message: "Updates go mod version to ${{ steps.setup-go.outputs.go-version }}"
pathspec: "."
keyid: ${{ secrets.INITIALIZ_BOT_GPG_SIGNING_KEY_ID }}
key: ${{ secrets.INITIALIZ_BOT_GPG_SIGNING_KEY }}

- name: Push Branch
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: initializ-buildpacks/github-config/actions/pull-request/push-branch@main
with:
branch: automation/go-mod-update/update-main

- name: Open Pull Request
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: initializ-buildpacks/github-config/actions/pull-request/open@main
with:
token: ${{ secrets.PAT }}
title: "Updates go mod version to ${{ steps.setup-go.outputs.go-version }}"
branch: automation/go-mod-update/update-main

failure:
name: Alert on Failure
runs-on: ubuntu-22.04
needs: [update-go]
if: ${{ always() && needs.update-go.result == 'failure' }}
steps:
- name: File Failure Alert Issue
uses: initializ-buildpacks/github-config/actions/issue/file@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
label: "failure:update-go-version"
comment_if_exists: true
issue_title: "Failure: Update Go Mod Version workflow"
issue_body: |
Update Go Mod Version workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).
comment_body: |
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

Check failure on line 93 in .github/workflows/update-go-mod-version.yml

View workflow job for this annotation

GitHub Actions / lintYaml

93:112 [new-line-at-end-of-file] no new line character at the end of file
4 changes: 2 additions & 2 deletions scripts/.util/tools.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"pack": "v0.34.2"
}
"pack": "v0.33.2"
}

0 comments on commit 495ac2a

Please sign in to comment.