From d6eb357adc11e753ed8b45758e4b6940f74b5f46 Mon Sep 17 00:00:00 2001 From: Sam Hampton Date: Fri, 22 Mar 2024 15:07:05 +0000 Subject: [PATCH] chore: updates --- .github/settings.yml | 2 +- .github/workflows/test.yml | 16 ---------------- action.yml | 20 +++++++++++++------- 3 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/settings.yml b/.github/settings.yml index 4cbb940..02c02ac 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -1,6 +1,6 @@ --- repository: - name: action=bootstrap + name: action-bootstrap description: | A Github action to perform common tasks for build pipelines. topics: github, actions, ci, scripts, ecr, docker diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 10394e6..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: test - -on: - workflow_dispatch: - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: build - uses: ./ - with: - ecr-repo-name: intercontinental \ No newline at end of file diff --git a/action.yml b/action.yml index 0906e90..c13c4c0 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,14 @@ description: | inputs: ecr-repo-name: required: true + role-to-assume: + required: true + role-session-name: + required: true + aws-region: + required: true + aws-account-id: + required: true runs: using: 'composite' @@ -20,9 +28,9 @@ runs: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4.0.2 with: - role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_OPS_GH_CI }} - role-session-name: ${{ secrets.AWS_OPS_SESSION_NAME }} - aws-region: ${{ secrets.AWS_OPS_DEFAULT_REGION }} + role-to-assume: ${{ inputs.role-to-assume }} + role-session-name: ${{ inputs.role-session-name }} + aws-region: ${{ inputs.aws-region }} - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v2 @@ -30,9 +38,7 @@ runs: id: img-name run: | if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "ecr-repo-name=${{secrets.AWS_OPS_ACCOUNT_ID}}.dkr.ecr.${{ secrets.AWS_OPS_DEFAULT_REGION }}.amazonaws.com/alpha-image/${{ env.ECR_REPO_NAME }}" >>"${GITHUB_OUTPUT}" + echo "ecr-repo-name=${{inputs.aws-account-id}}.dkr.ecr.${{ inputs.aws-region }}.amazonaws.com/alpha-image/${{ inputs.ecr-repo-name }}" >>"${GITHUB_OUTPUT}" else - echo "ecr-repo-name=${{secrets.AWS_OPS_ACCOUNT_ID}}.dkr.ecr.${{ secrets.AWS_OPS_DEFAULT_REGION }}.amazonaws.com/image/${{ env.ECR_REPO_NAME }}" >>"${GITHUB_OUTPUT}" + echo "ecr-repo-name=${{inputs.aws-account-id}}.dkr.ecr.${{ inputs.aws-region }}.amazonaws.com/image/${{ inputs.ecr-repo-name }}" >>"${GITHUB_OUTPUT}" fi - env: - ECR_REPO_NAME: ${{ inputs.ecr-repo-name }}