only run if environment is not ghes

This commit is contained in:
David Daly
2024-02-02 13:04:35 -05:00
committed by Edwin Sirko
parent dfbae910c5
commit 621cb8210d
8 changed files with 35 additions and 351 deletions
+3 -12
View File
@@ -1,22 +1,11 @@
name: 'Package and Publish'
description: 'Publish actions as OCI artifacts to GHCR'
permissions:
id-token: write
contents: write
packages: write
# TODO: Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: 'heart'
color: 'red'
inputs:
path:
required: false
description: The work directory or path to be tar archived and uploaded as OCI Artifact layer.
default: '.'
outputs:
package-url:
description: 'The name of package published to GHCR along with semver. For example, https://ghcr.io/actions/package-action:1.0.1'
@@ -27,11 +16,12 @@ outputs:
package-manifest-sha:
description: 'A sha256 hash of the package manifest'
value: ${{steps.publish.outputs.package-manifest-sha}}
runs:
using: 'composite'
steps:
- name: Publish Action Package
run: 'node ${{github.action_path}}/dist/index.js --path ${{ inputs.path }}'
run: 'node ${{github.action_path}}/dist/index.js'
shell: bash
id: publish
env:
@@ -49,6 +39,7 @@ runs:
- name: Generate Provenance Attestation
uses: github-early-access/generate-build-provenance@main
id: build-provenance
if: contains(github.server_url, 'github.com') || contains(github.server_url, 'ghe.com')
with:
subject-name: ${{github.repository}}_${{github.ref}}
subject-digest: ${{steps.publish.outputs.package-manifest-sha}}