Download test #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Hello' | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
who: | |
description: 'Test Workflow' | |
required: true | |
type: string | |
message: | |
description: 'Commit Message' | |
required: true | |
type: string | |
jobs: | |
hello_world_job: | |
runs-on: ubuntu-latest | |
name: A job to say hello | |
steps: | |
- uses: actions/checkout@v4 | |
- id: foo | |
uses: MohammedSentry/hello-world-composite-action@v2 | |
with: | |
who-to-greet: ${{ inputs.who || 'Mona the Octocat'}} | |
- run: echo random-number "$RANDOM_NUMBER" | |
shell: bash | |
env: | |
RANDOM_NUMBER: ${{ steps.foo.outputs.random-number }} | |
- name: Checkout the source repository | |
uses: actions/checkout@v4 | |
with: | |
repository: MohammedSentry/hello-world-composite-action | |
ref: main # Spécifiez explicitement la branche, par exemple 'main' ou 'master' | |
path: source-repo | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Copy files to the download directory | |
run: | | |
mkdir -p download | |
cp -R source-repo/* download/ | |
- name: Remove source repository | |
run: rm -rf source-repo | |
- name: Commit and push files | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add download/ | |
if [ -z "${{ inputs.message }}" ]; then | |
echo "Commit message is empty. Aborting commit." | |
exit 1 | |
fi | |
git commit -m "${{ inputs.message }}" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |