Skip to content

MetricsHub Sanity Check #29

MetricsHub Sanity Check

MetricsHub Sanity Check #29

Workflow file for this run

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.PAT_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 https://x-access-token:${{ secrets.PAT_TOKEN }}@github.com/MohammedSentry/test-workflow.git HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}