@@ -91,15 +91,70 @@ branding:
9191 color : yellow
9292 icon : upload-cloud
9393runs :
94- using : docker
95- image : Dockerfile
96- args :
97- - ${{ inputs.user }}
98- - ${{ inputs.password }}
99- - ${{ inputs.repository-url }}
100- - ${{ inputs.packages-dir }}
101- - ${{ inputs.verify-metadata }}
102- - ${{ inputs.skip-existing }}
103- - ${{ inputs.verbose }}
104- - ${{ inputs.print-hash }}
105- - ${{ inputs.attestations }}
94+ using : composite
95+ steps :
96+ - name : Fail-fast in unsupported environments
97+ if : runner.os != 'Linux'
98+ run : |
99+ >&2 echo This action is only able to run under GNU/Linux environments
100+ exit 1
101+ shell : bash -eEuo pipefail {0}
102+ - name : Reset path if needed
103+ run : |
104+ # Reset path if needed
105+ # https://github.com/pypa/gh-action-pypi-publish/issues/112
106+ if [[ $PATH != *"/usr/bin"* ]]; then
107+ echo "\$PATH=$PATH. Resetting \$PATH for GitHub Actions."
108+ PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
109+ echo "PATH=$PATH" >>"$GITHUB_ENV"
110+ echo "$PATH" >>"$GITHUB_PATH"
111+ echo "\$PATH reset. \$PATH=$PATH"
112+ fi
113+ shell : bash
114+ - name : Set repo and ref from which to run Docker container action
115+ id : set-repo-and-ref
116+ run : |
117+ # Set repo and ref from which to run Docker container action
118+ # to handle cases in which `github.action_` context is not set
119+ # https://github.com/actions/runner/issues/2473
120+ REF=${{ env.ACTION_REF || env.PR_REF || github.ref_name }}
121+ REPO=${{ env.ACTION_REPO || env.PR_REPO || github.repository }}
122+ REPO_ID=${{ env.PR_REPO_ID || github.repository_id }}
123+ echo "ref=$REF" >>"$GITHUB_OUTPUT"
124+ echo "repo=$REPO" >>"$GITHUB_OUTPUT"
125+ echo "repo-id=$REPO_ID" >>"$GITHUB_OUTPUT"
126+ shell : bash
127+ env :
128+ ACTION_REF : ${{ github.action_ref }}
129+ ACTION_REPO : ${{ github.action_repository }}
130+ PR_REF : ${{ github.event.pull_request.head.ref }}
131+ PR_REPO : ${{ github.event.pull_request.head.repo.full_name }}
132+ PR_REPO_ID : ${{ github.event.pull_request.base.repo.id }}
133+ - name : Check out action repo
134+ uses : actions/checkout@v4
135+ with :
136+ path : action-repo
137+ ref : ${{ steps.set-repo-and-ref.outputs.ref }}
138+ repository : ${{ steps.set-repo-and-ref.outputs.repo }}
139+ - name : Create Docker container action
140+ run : |
141+ # Create Docker container action
142+ python create-docker-action.py
143+ env :
144+ REF : ${{ steps.set-repo-and-ref.outputs.ref }}
145+ REPO : ${{ steps.set-repo-and-ref.outputs.repo }}
146+ REPO_ID : ${{ steps.set-repo-and-ref.outputs.repo-id }}
147+ shell : bash
148+ working-directory : action-repo
149+ - name : Run Docker container
150+ uses : ./action-repo/.github/actions/run-docker-container
151+ with :
152+ user : ${{ inputs.user }}
153+ password : ${{ inputs.password }}
154+ repository-url : ${{ inputs.repository-url || inputs.repository_url }}
155+ packages-dir : ${{ inputs.packages-dir || inputs.packages_dir }}
156+ verify-metadata : ${{ inputs.verify-metadata || inputs.verify_metadata }}
157+ skip-existing : ${{ inputs.skip-existing || inputs.skip_existing }}
158+ verbose : ${{ inputs.verbose }}
159+ print-hash : ${{ inputs.print-hash || inputs.print_hash }}
160+ attestations : ${{ inputs.attestations }}
0 commit comments