Skip to content

Manual workflow

Manual workflow #4

Workflow file for this run

# This is a basic workflow that is manually triggered
name: Manual workflow
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
name:
description: 'Person to greet'
default: 'Sean'
required: true
type: string
repository:
description: 'GitHub repository from which to download the file (e.g., user/repo)'
default: 'Repick-official/repick-server-v2'
required: true
type: string
branch:
description: 'Branch from which to download the file (e.g., main)'
default: 'develop'
required: true
type: string
filepath:
description: 'Path to the file within the repository (e.g., README.md)'
default: 'README.md'
required: true
type: string
jobs:
download-file:
runs-on: ubuntu-latest
steps:
# Step 1: Greet the user
- name: Send greeting
run: echo "Hello ${{ inputs.name }}"
# Step 2: Download the file using curl
- name: Download file using curl
run: |
echo "Downloading ${{ inputs.filepath }} from ${{ inputs.repository }} on branch ${{ inputs.branch }}"
sudo curl -o readme.md https://raw.githubusercontent.com/${{ inputs.repository }}/${{ inputs.branch }}/${{ inputs.filepath }}
# Step 3: List the downloaded file to confirm
- name: Confirm file download
run: cat readme.md
# Step 4: Commit and push changes to the repository
- name: Commit and push changes
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git add readme.md
git commit -m "Update README.md from ${{ inputs.repository }} (branch: ${{ inputs.branch }})"
git push
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}