## What - Pin all GitHub Actions to their specific SHA1 hashes to reduce supply chain attack risk - Replaces version tags with specific commit SHAs - Includes version comments for easier reference - Changes generated with the pinact tool See internal wiki page on supply chain security for further info ## How Used the tool pinact to pin the sha for github actions. ## Review guide <!-- 1. `x.py` 2. `y.py` --> ## User Impact No impact ## Can this PR be safely reverted and rolled back? - [x] YES 💚 - [ ] NO ❌
139 lines
4.8 KiB
YAML
139 lines
4.8 KiB
YAML
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
|
|
|
|
name: Publish Bulk CDK
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- "airbyte-cdk/bulk/**"
|
|
workflow_dispatch:
|
|
inputs:
|
|
build-number:
|
|
description: "Build Number"
|
|
required: false
|
|
type: number
|
|
workflow_call:
|
|
|
|
concurrency:
|
|
group: publish-bulk-cdk
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
|
|
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
|
|
|
|
jobs:
|
|
publish-bulk-cdk:
|
|
name: Publish Bulk CDK
|
|
runs-on: linux-24.04-large # Custom runner, defined in GitHub org settings
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout Airbyte
|
|
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@17f84c3641ba7b8f6deff6309fc4c864478f5d62 # v3.14.1
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: "21"
|
|
|
|
- name: Docker login
|
|
# Some tests use testcontainers which pull images from DockerHub.
|
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1.14.1
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
|
|
- name: Error if CDK Version Exists
|
|
uses: burrunan/gradle-cache-action@3bf23b8dd95e7d2bacf2470132454fe893a178a1 # v1
|
|
env:
|
|
CI: true
|
|
with:
|
|
job-id: bulk-cdk-publish
|
|
concurrent: true
|
|
gradle-distribution-sha-256-sum-warning: false
|
|
arguments: --scan :airbyte-cdk:bulk:checkBuildNumber
|
|
|
|
- name: Build Bulk CDK
|
|
uses: burrunan/gradle-cache-action@3bf23b8dd95e7d2bacf2470132454fe893a178a1 # v1
|
|
env:
|
|
CI: true
|
|
with:
|
|
job-id: bulk-cdk-publish
|
|
concurrent: true
|
|
gradle-distribution-sha-256-sum-warning: false
|
|
arguments: --scan :airbyte-cdk:bulk:bulkCdkBuild
|
|
|
|
- name: Publish Poms and Jars to CloudRepo
|
|
uses: burrunan/gradle-cache-action@3bf23b8dd95e7d2bacf2470132454fe893a178a1 # v1
|
|
env:
|
|
CI: true
|
|
CLOUDREPO_USER: ${{ secrets.CLOUDREPO_USER }}
|
|
CLOUDREPO_PASSWORD: ${{ secrets.CLOUDREPO_PASSWORD }}
|
|
with:
|
|
job-id: bulk-cdk-publish
|
|
read-only: true
|
|
concurrent: true
|
|
execution-only-caches: true
|
|
gradle-distribution-sha-256-sum-warning: false
|
|
arguments: --scan :airbyte-cdk:bulk:bulkCdkPublish
|
|
|
|
- name: Post failure to Slack channel
|
|
if: ${{ env.DRY_RUN == 'false' && failure() }}
|
|
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
|
|
continue-on-error: true
|
|
with:
|
|
channel-id: C07K1P3UL6Q # The `#dev-java-cdk-releases` channel
|
|
payload: |
|
|
{
|
|
"text": "Error while publishing Bulk CDK!",
|
|
"blocks": [
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": "Error while publishing Bulk CDK!"
|
|
}
|
|
},
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": "See details on <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|GitHub>\n"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
env:
|
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
|
|
|
|
- name: Post success to Slack channel
|
|
if: ${{ env.DRY_RUN == 'false' && !failure() }}
|
|
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
|
|
continue-on-error: true
|
|
with:
|
|
channel-id: C07K1P3UL6Q # The `#dev-java-cdk-releases` channel
|
|
payload: |
|
|
{
|
|
"text": "Bulk CDK version 0.${{ env.BUILD_NUMBER }} published successfully!",
|
|
"blocks": [
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": "Bulk CDK version 0.${{ env.BUILD_NUMBER }} published successfully!"
|
|
}
|
|
},
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": "See details on <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|GitHub>\n"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
env:
|
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
|