From 141fe4af7e80b05da3838766098ddee8423a0f46 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Thu, 23 Apr 2026 13:43:41 -0400 Subject: [PATCH 1/3] remove ServerlessOpsIO/gha-artifact-name usage. When I wrote this initially I was under the belief that runs would overwrite artifacts from previous runs if the name wasn't unique but upon looking at GitHub recently that's not the case. Removing this because we don't need it. Not sure we ever needed it. --- action.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/action.yaml b/action.yaml index 8125e7c..5995068 100644 --- a/action.yaml +++ b/action.yaml @@ -9,9 +9,6 @@ inputs: description: AWS region to deploy to required: false default: us-east-1 - artifact_name_override: - description: Override name of artifact - required: false artifact_retention_days: description: Number of days to retain artifacts required: false @@ -31,12 +28,6 @@ inputs: runs: using: composite steps: - - name: Set artifact name - id: set-artifact-name - uses: ServerlessOpsIO/gha-artifact-name@v1 - with: - artifact_name_override: ${{ inputs.artifact_name_override }} - - name: Package & Upload SAM artifact id: package-sam if: ${{ inputs.use_aws_sam }} @@ -51,7 +42,6 @@ runs: id: upload-artifact uses: actions/upload-artifact@v4 with: - name: ${{ steps.set-artifact-name.outputs.artifact-name }} path: | **/* !.aws-sam/build @@ -61,9 +51,6 @@ runs: retention-days: ${{ inputs.artifact_retention_days }} outputs: - artifact-name: - description: Name of artifact stored - value: ${{ steps.set-artifact-name.outputs.artifact-name }} packaged-template: description: Path to packaged SAM template file value: ${{ steps.package-sam.outputs.packaged-template }} From 9dbe5183a398c53b0587fac8e6c52e93af20bcb5 Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Thu, 23 Apr 2026 16:09:58 -0400 Subject: [PATCH 2/3] update doc --- README.md | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index c8c05fd..d9c6bd4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Store job artifacts in GitHub. -This GitHub Action allows you to store artifacts generated during your workflow. It supports setting custom artifact names and retaining artifacts for a specified number of days. +This GitHub Action allows you to store artifacts generated during your workflow. It additionally supports packaging and storing AWS SAM artifacts for serverless applications. For more information on what happens when `use_aws_sam` is true see [ServerlessOpsIO/gha-package-aws-sam](https://github.com/ServerlessOpsIO/gha-deploy-aws-sam/actions). @@ -10,16 +10,14 @@ _**NOTE: This workflow is opinionated and meets the needs of its author. It is p The `gha-store-artifacts` action performs the following tasks: 1. Checks if the GitHub environment variable `GITHUB_REPOSITORY_OWNER_PART_SLUG_URL` is set and fails if not. -2. Optionally uploads a SAM artifact if specified. -3. Sets the artifact name based on the provided override or generates a default name. -4. Uploads the job working directory as an artifact to GHA +1. Optionally uploads a SAM artifact if specified. +1. Uploads the job working directory as an artifact to GHA ## Usage See below for inputs, outputs, and examples. ### Inputs -- `artifact_name_override` (optional): Override the name of the artifact. - `artifact_retention_days` (optional): Number of days to retain artifacts.. - `use_aws_sam` (optional): Boolean to determine if SAM artifact should be uploaded. - `aws_account_region` (optional): AWS region to use for SAM packaging. @@ -28,7 +26,6 @@ See below for inputs, outputs, and examples. ### Outputs -- `artifact-name`: The name of the artifact stored. - `sam-artifact-bucket`: The S3 bucket where the SAM artifact was uploaded. - `sam-artifact-bucket-prefix`: The S3 prefix where the SAM artifact was uploaded. @@ -102,38 +99,6 @@ jobs: ``` -#### Artifact naming -Both [ServerlessOpsIO/gha-setup-workspace](https://github.com/ServerlessOpsIO/gha-setup-workspace) and [ServerlessOpsIO/gha-store-artifacts](https://github.com/ServerlessOpsIO/gha-store-artifacts) use the same [utility action](https://github.com/ServerlessOpsIO/gha-artifact-name) to set an artifact name if `artifact_name_override` is not set. If your workflow sets _artifact_name_override_ for `ServerlessOpsIO/gha-setup-workspace` be sure to use that actions _artifact_name_ output to set _artifact_name_override_ for `ServerlessOpsIO/gha-store-artifacts`. - -See the example below: - -```yaml -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Setup job workspace - uses: ServerlessOpsIO/gha-setup-workspace@v1 - - name: Store Artifacts - uses: ServerlessOpsIO/gha-store-artifacts@v1 - with: - artifact_name_override: 'MyArtifactName' - outputs: - artifact-name: ${{ steps.setup-workspace.outputs.artifact-name }} - - deploy: - runs-on: ubuntu-latest - needs: - - build - steps: - - name: Setup job workspace - uses: ServerlessOpsIO/gha-setup-workspace@v1 - with: - checkout_artifact: true - artifact_name_override: ${{ needs.build.outputs.artifact-name }} - -``` - #### S3 Bucket The default value for `sam_s3_bucket` comes from [ServerlessOpsIO/aws-gha-integration](https://github.com/ServerlessOpsIO/aws-gha-integration). Both the `sam_s3_bucket` and `sam_s3_prefix` should not need to be configured but are avavailbel for unique circumstances. From 40513c983eeb60045c621207fe98ec53f5c35f7a Mon Sep 17 00:00:00 2001 From: Tom McLaughlin Date: Thu, 23 Apr 2026 17:44:40 -0400 Subject: [PATCH 3/3] apply a round of copilot review suggestions Co-authored-by: Copilot --- README.md | 5 ++--- action.yaml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d9c6bd4..e8cc2f5 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,13 @@ Store job artifacts in GitHub. This GitHub Action allows you to store artifacts generated during your workflow. It additionally supports packaging and storing AWS SAM artifacts for serverless applications. -For more information on what happens when `use_aws_sam` is true see [ServerlessOpsIO/gha-package-aws-sam](https://github.com/ServerlessOpsIO/gha-deploy-aws-sam/actions). +For more information on what happens when `use_aws_sam` is true see [ServerlessOpsIO/gha-package-aws-sam](https://github.com/ServerlessOpsIO/gha-deploy-aws-sam). _**NOTE: This workflow is opinionated and meets the needs of its author. It is provided publicly as a reference for others to use and modify as needed.**_ The `gha-store-artifacts` action performs the following tasks: -1. Checks if the GitHub environment variable `GITHUB_REPOSITORY_OWNER_PART_SLUG_URL` is set and fails if not. 1. Optionally uploads a SAM artifact if specified. -1. Uploads the job working directory as an artifact to GHA +1. Uploads the job working directory as an artifact to GHA. ## Usage See below for inputs, outputs, and examples. diff --git a/action.yaml b/action.yaml index 5995068..dc1d713 100644 --- a/action.yaml +++ b/action.yaml @@ -30,7 +30,7 @@ runs: steps: - name: Package & Upload SAM artifact id: package-sam - if: ${{ inputs.use_aws_sam }} + if: ${{ inputs.use_aws_sam == 'true' }} uses: ServerlessOpsIO/gha-package-aws-sam@v1 with: aws_account_region: ${{ inputs.aws_account_region }}