Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ jobs:
# unit tests
units:
runs-on: ubuntu-latest
env:
# ncc@0.28.6 uses legacy OpenSSL hashing; Node 20+ requires this flag
NODE_OPTIONS: --openssl-legacy-provider
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- run: npm ci
- run: npm test

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
description: "If set, always create SSH debug sessions even on success."
required: false
runs:
using: 'node16'
using: 'node20'
main: 'dist/index.js'
pre: 'dist/setup.js'
post: 'dist/cleanup.js'
29 changes: 29 additions & 0 deletions common/branch-info/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Branch Info"
description: "Extracts branch name and short SHA from the GitHub context. Reusable across all actions."

outputs:
branch:
description: "The branch name (handles both push and pull_request events)"
value: ${{ steps.set-branch.outputs.branch }}
short_sha:
description: "The first 7 characters of the commit SHA"
value: ${{ steps.get-short-sha.outputs.short_sha }}

runs:
using: "composite"
steps:
- name: Set branch variable
id: set-branch
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
branch="${{ github.event.pull_request.head.ref }}"
else
branch="${{ github.ref }}"
branch="${branch#refs/heads/}"
fi
echo "branch=${branch}" >> $GITHUB_OUTPUT
- name: Get short sha
id: get-short-sha
shell: bash
run: echo "short_sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
36 changes: 12 additions & 24 deletions deploy/eks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Set branch variable
id: set-branch
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
branch="${{ github.event.pull_request.head.ref }}"
else
branch="${{ github.ref }}"
branch="${branch#refs/heads/}"
fi
echo "branch=${branch}" >> $GITHUB_OUTPUT
- name: Get short sha
id: get-short-sha
run: echo "short_sha=`echo ${GITHUB_SHA::7}`" >> $GITHUB_OUTPUT
shell: bash
- name: Get branch and commit info
id: branch-info
uses: wishabi/github-actions/common/branch-info@v0
- name: Validate AWS credentials input
shell: bash
run: |
Expand Down Expand Up @@ -100,15 +88,15 @@ runs:
# Execute command
eval $cmd
- name: Notify slack channel on success
if: success() && inputs.SLACK_SUCCESS_CHANNEL_ID != null
uses: slackapi/slack-github-action@v1.24.0
if: success() && inputs.SLACK_SUCCESS_CHANNEL_ID != ''
uses: slackapi/slack-github-action@v1.27.1
env:
SLACK_BOT_TOKEN: ${{ inputs.SLACK_BOT_TOKEN }}
with:
channel-id: ${{ inputs.SLACK_SUCCESS_CHANNEL_ID }}
payload: |
{
"text": "EKS Deplloyment Succeeded",
"text": "EKS Deployment Succeeded",
"blocks": [
{
"type": "header",
Expand Down Expand Up @@ -149,11 +137,11 @@ runs:
},
{
"type": "mrkdwn",
"text": "${{ format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.set-branch.outputs.branch)}}"
"text": "${{ format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.branch-info.outputs.branch)}}"
},
{
"type": "mrkdwn",
"text": "${{ steps.get-short-sha.outputs.short_sha }}"
"text": "${{ steps.branch-info.outputs.short_sha }}"
}
]
},
Expand All @@ -172,8 +160,8 @@ runs:
]
}
- name: Notify slack channel on failure
if: failure() && inputs.SLACK_FAILURE_CHANNEL_ID != null
uses: slackapi/slack-github-action@v1.24.0
if: failure() && inputs.SLACK_FAILURE_CHANNEL_ID != ''
uses: slackapi/slack-github-action@v1.27.1
env:
SLACK_BOT_TOKEN: ${{ inputs.SLACK_BOT_TOKEN }}
with:
Expand Down Expand Up @@ -221,11 +209,11 @@ runs:
},
{
"type": "mrkdwn",
"text": "${{ format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.set-branch.outputs.branch)}}"
"text": "${{ format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.branch-info.outputs.branch)}}"
},
{
"type": "mrkdwn",
"text": "${{ steps.get-short-sha.outputs.short_sha }}"
"text": "${{ steps.branch-info.outputs.short_sha }}"
}
]
},
Expand Down
26 changes: 7 additions & 19 deletions go/build-and-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Set branch variable
id: set-branch
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
branch="${{ github.event.pull_request.head.ref }}"
else
branch="${{ github.ref }}"
branch="${branch#refs/heads/}"
fi
echo "branch=${branch}" >> $GITHUB_OUTPUT
- name: Get short sha
id: get-short-sha
run: echo "short_sha=`echo ${GITHUB_SHA::7}`" > $GITHUB_OUTPUT
shell: bash
- name: Get branch and commit info
id: branch-info
uses: wishabi/github-actions/common/branch-info@v0
- name: Run custom Go build action
uses: wishabi/github-actions/go/build@v0
with:
Expand All @@ -72,8 +60,8 @@ runs:
TAGS: ${{ inputs.TEST_TAGS }}
TIMEOUT: ${{ inputs.TIMEOUT }}
- name: Notify slack channel on failure
if: failure() && inputs.SLACK_CHANNEL_ID != null && github.ref == 'refs/heads/main'
uses: slackapi/slack-github-action@v1.24.0
if: failure() && inputs.SLACK_CHANNEL_ID != '' && github.ref == 'refs/heads/main'
uses: slackapi/slack-github-action@v1.27.1
env:
SLACK_BOT_TOKEN: ${{ inputs.SLACK_BOT_TOKEN }}
with:
Expand All @@ -97,7 +85,7 @@ runs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Repository*\n<https://github.com/${{ github.repository }}|${{ github.repository }}>\n\n*${{ github.event_name == 'pull_request' && 'Pull Request' || 'Branch' }}*\n${{ github.event_name == 'pull_request' && format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) || format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.set-branch.outputs.branch)}}"
"text": "*Repository*\n<https://github.com/${{ github.repository }}|${{ github.repository }}>\n\n*${{ github.event_name == 'pull_request' && 'Pull Request' || 'Branch' }}*\n${{ github.event_name == 'pull_request' && format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) || format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.branch-info.outputs.branch)}}"
},
"accessory": {
"type": "image",
Expand All @@ -121,7 +109,7 @@ runs:
},
{
"type": "mrkdwn",
"text": "${{ steps.get-short-sha.outputs.short_sha }}"
"text": "${{ steps.branch-info.outputs.short_sha }}"
},
{
"type": "mrkdwn",
Expand Down
43 changes: 24 additions & 19 deletions go/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Set branch variable
id: set-branch
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
branch="${{ github.event.pull_request.head.ref }}"
else
branch="${{ github.ref }}"
branch="${branch#refs/heads/}"
fi
echo "branch=${branch}" >> $GITHUB_OUTPUT
- name: Get short sha
id: get-short-sha
run: echo "short_sha=`echo ${GITHUB_SHA::7}`" > $GITHUB_OUTPUT
shell: bash
- name: Get branch and commit info
id: branch-info
uses: wishabi/github-actions/common/branch-info@v0
- name: Configure Go environment
uses: wishabi/github-actions/go/configure@v0
with:
Expand All @@ -48,9 +36,26 @@ runs:
BUF_TOKEN: ${{ inputs.BUF_BUILD_API_TOKEN }}
with:
FLIPPCIRCLECIPULLER_REPO_TOKEN: ${{ inputs.FLIPPCIRCLECIPULLER_REPO_TOKEN }}
- name: Write build summary
if: always()
shell: bash
run: |
echo "## Go Build Results" >> $GITHUB_STEP_SUMMARY
echo "| Setting | Value |" >> $GITHUB_STEP_SUMMARY
echo "|---------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Go | $(go version | awk '{print $3}') |" >> $GITHUB_STEP_SUMMARY
echo "| Repository | ${{ github.repository }} |" >> $GITHUB_STEP_SUMMARY
echo "| Commit | ${{ steps.branch-info.outputs.short_sha }} |" >> $GITHUB_STEP_SUMMARY
if [ "${{ job.status }}" = "success" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "> Build passed" >> $GITHUB_STEP_SUMMARY
else
echo "" >> $GITHUB_STEP_SUMMARY
echo "> **Build failed** — check the logs above for details" >> $GITHUB_STEP_SUMMARY
fi
- name: Notify slack channel on failure
if: failure() && inputs.SLACK_CHANNEL_ID != null && github.ref == 'refs/heads/main'
uses: slackapi/slack-github-action@v1.24.0
if: failure() && inputs.SLACK_CHANNEL_ID != '' && github.ref == 'refs/heads/main'
uses: slackapi/slack-github-action@v1.27.1
env:
SLACK_BOT_TOKEN: ${{ inputs.SLACK_BOT_TOKEN }}
with:
Expand All @@ -74,7 +79,7 @@ runs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Repository*\n<https://github.com/${{ github.repository }}|${{ github.repository }}>\n\n*${{ github.event_name == 'pull_request' && 'Pull Request' || 'Branch' }}*\n${{ github.event_name == 'pull_request' && format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) || format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.set-branch.outputs.branch)}}"
"text": "*Repository*\n<https://github.com/${{ github.repository }}|${{ github.repository }}>\n\n*${{ github.event_name == 'pull_request' && 'Pull Request' || 'Branch' }}*\n${{ github.event_name == 'pull_request' && format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) || format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.branch-info.outputs.branch)}}"
},
"accessory": {
"type": "image",
Expand All @@ -98,7 +103,7 @@ runs:
},
{
"type": "mrkdwn",
"text": "${{ steps.get-short-sha.outputs.short_sha }}"
"text": "${{ steps.branch-info.outputs.short_sha }}"
},
{
"type": "mrkdwn",
Expand Down
13 changes: 13 additions & 0 deletions go/deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ runs:
if: ${{ hashFiles('buf.gen.yaml') != '' }}
run: buf generate
shell: bash
- name: Log tool versions
shell: bash
run: |
echo "::group::Tool Versions"
echo "Go: $(go version)"
if command -v buf &> /dev/null; then echo "Buf: $(buf --version)"; fi
echo "::endgroup::"
- name: Setting up private modules access
if: steps.vendor-cache.outputs.cache-hit != 'true'
shell: bash
Expand Down Expand Up @@ -81,5 +88,11 @@ runs:
if: ${{ hashFiles('.mockery.yml') != '' }}
run: mockery
shell: bash
- name: Log generated tool versions
shell: bash
run: |
echo "::group::Generated Tool Versions"
if command -v mockery &> /dev/null; then echo "Mockery: $(mockery --version 2>/dev/null || echo 'installed but version unknown')"; fi
echo "::endgroup::"
- name: Caching workspace for deploy jobs
uses: wishabi/github-actions/cache@v0
56 changes: 35 additions & 21 deletions go/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Set branch variable
id: set-branch
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
branch="${{ github.event.pull_request.head.ref }}"
else
branch="${{ github.ref }}"
branch="${branch#refs/heads/}"
fi
echo "branch=${branch}" >> $GITHUB_OUTPUT
- name: Get short sha
id: get-short-sha
run: echo "short_sha=`echo ${GITHUB_SHA::7}`" > $GITHUB_OUTPUT
shell: bash
- name: Get branch and commit info
id: branch-info
uses: wishabi/github-actions/common/branch-info@v0
- name: Configure Go environment
uses: wishabi/github-actions/go/configure@v0
with:
Expand Down Expand Up @@ -85,23 +73,49 @@ runs:
echo "IS_V2=${IS_V2}" >> $GITHUB_ENV
echo "GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION}" >> $GITHUB_ENV
shell: bash
- name: Log tool versions
shell: bash
run: |
echo "::group::Tool Versions"
echo "Go: $(go version)"
if [ -n "${{ env.GOLANGCI_LINT_VERSION }}" ]; then echo "golangci-lint: ${{ env.GOLANGCI_LINT_VERSION }}"; fi
echo "::endgroup::"
- name: Run v1 Go linter
if : ${{ env.IS_V2 == 'false' }}
if: ${{ env.IS_V2 == 'false' }}
uses: golangci/golangci-lint-action@v6
with:
skip-cache: true
args: --verbose
version: ${{ env.GOLANGCI_LINT_VERSION }} # Optional - if blank, will use the action's default version resolution
- name: Run v2 Go linter
if : ${{ env.IS_V2 == 'true' }}
if: ${{ env.IS_V2 == 'true' }}
uses: golangci/golangci-lint-action@v7 # Note: v7 and up require golangci-lint v2 config
with:
skip-cache: true
args: --verbose
version: ${{ env.GOLANGCI_LINT_VERSION }} # Optional - if blank, will use the action's default version resolution
- name: Write lint summary
if: always()
shell: bash
run: |
echo "## Go Lint Results" >> $GITHUB_STEP_SUMMARY
echo "| Setting | Value |" >> $GITHUB_STEP_SUMMARY
echo "|---------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Go | $(go version | awk '{print $3}') |" >> $GITHUB_STEP_SUMMARY
if [ -n "${{ env.GOLANGCI_LINT_VERSION }}" ]; then
echo "| golangci-lint | ${{ env.GOLANGCI_LINT_VERSION }} |" >> $GITHUB_STEP_SUMMARY
fi
echo "| Config version | ${{ env.IS_V2 == 'true' && 'v2' || 'v1' }} |" >> $GITHUB_STEP_SUMMARY
if [ "${{ job.status }}" = "success" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "> Lint passed" >> $GITHUB_STEP_SUMMARY
else
echo "" >> $GITHUB_STEP_SUMMARY
echo "> **Lint failed** — check the logs above for details" >> $GITHUB_STEP_SUMMARY
fi
- name: Notify slack channel on failure
if: failure() && inputs.SLACK_CHANNEL_ID != null && github.ref == 'refs/heads/main'
uses: slackapi/slack-github-action@v1.24.0
if: failure() && inputs.SLACK_CHANNEL_ID != '' && github.ref == 'refs/heads/main'
uses: slackapi/slack-github-action@v1.27.1
env:
SLACK_BOT_TOKEN: ${{ inputs.SLACK_BOT_TOKEN }}
with:
Expand All @@ -125,7 +139,7 @@ runs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Repository*\n<https://github.com/${{ github.repository }}|${{ github.repository }}>\n\n*${{ github.event_name == 'pull_request' && 'Pull Request' || 'Branch' }}*\n${{ github.event_name == 'pull_request' && format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) || format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.set-branch.outputs.branch)}}"
"text": "*Repository*\n<https://github.com/${{ github.repository }}|${{ github.repository }}>\n\n*${{ github.event_name == 'pull_request' && 'Pull Request' || 'Branch' }}*\n${{ github.event_name == 'pull_request' && format('<{0}|{1}>', github.event.pull_request.html_url, github.event.pull_request.title) || format('<https://github.com/{0}/commit/{1}|{2}>', github.repository, github.sha, steps.branch-info.outputs.branch)}}"
},
"accessory": {
"type": "image",
Expand All @@ -149,7 +163,7 @@ runs:
},
{
"type": "mrkdwn",
"text": "${{ steps.get-short-sha.outputs.short_sha }}"
"text": "${{ steps.branch-info.outputs.short_sha }}"
},
{
"type": "mrkdwn",
Expand Down
Loading
Loading