Randark-JMT is registering a user as [ Randark ] 🚀 #5
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: User Registration / 用户注册 | |
run-name: ${{github.actor}} is registering a user as [ ${{ inputs.username }} ] 🚀 | |
on: | |
workflow_dispatch: | |
inputs: | |
username: | |
description: "Username / 用户名" | |
required: true | |
type: string | |
email: | |
description: "E-mail Address / 邮箱地址" | |
required: true | |
type: string | |
biography: | |
description: "User's biography / 个人简介 " | |
required: true | |
type: string | |
jobs: | |
User-Registration: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Setup Python 3.12 Environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Run Registration Script | |
id: registration | |
run: | | |
output=$(python Registration.py ${{ github.actor}} ${{ inputs.username }} ${{ inputs.email }} ${{ inputs.biography }}) | |
echo "Output: $output" | |
echo "::set-output name=result::$output" | |
exit_code=$? | |
echo "Exit code: $exit_code" | |
echo "::set-output name=exit_code::$exit_code" | |
- name: Check Registration Status | |
run: | | |
echo "The script exit code was: ${{steps.registration.outputs.exit_code}}" | |
echo "The script output was: ${{steps.registration.outputs.result}}" | |
- name: Commit changes | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "Update files from GitHub Actions" || echo "No changes to commit" | |
- name: Push changes | |
run: | | |
git push origin HEAD:main |