add act_runner
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1s
This commit is contained in:
@@ -10,40 +10,72 @@ jobs:
|
|||||||
# shell: bash
|
# shell: bash
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: Manual repository checkout using git and bash
|
||||||
- name: Checkout repository manually using bash
|
|
||||||
run: |
|
run: |
|
||||||
# Ensure the workspace directory is clean and navigate into it
|
# The runner provides GITHUB_WORKSPACE environment variable
|
||||||
# GITHUB_WORKSPACE is an environment variable set by the runner
|
|
||||||
cd $GITHUB_WORKSPACE
|
cd $GITHUB_WORKSPACE
|
||||||
|
|
||||||
# Authenticate using the GITEA_TOKEN (managed by Gitea Actions)
|
# Use Gitea's built-in token to authenticate the clone operation
|
||||||
# GITHUB_SERVER_URL and GITHUB_REPOSITORY are also standard env vars
|
# GITHUB_SERVER_URL and GITHUB_REPOSITORY are standard environment variables
|
||||||
git clone --depth=1 https://${{ gitea.token }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git .
|
REPO_URL="https://${{ gitea.token }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git"
|
||||||
|
|
||||||
# Optional: checkout a specific pull request head if it's a PR event
|
echo "Cloning repository..."
|
||||||
# Note: Gitea uses refs/pull/:prNumber/head instead of merge commits for PRs
|
git clone --depth=1 $REPO_URL .
|
||||||
|
|
||||||
|
# Ensure we are on the correct commit/SHA for PRs or Pushes
|
||||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||||
git checkout ${{ github.event.pull_request.head.sha }}
|
git checkout ${{ github.event.pull_request.head.sha }}
|
||||||
|
else
|
||||||
|
git checkout ${{ github.sha }}
|
||||||
fi
|
fi
|
||||||
|
# Explicitly set shell to bash for clarity
|
||||||
- name: Check system info using bash
|
|
||||||
run: |
|
|
||||||
echo "Running on the host machine"
|
|
||||||
uname -a
|
|
||||||
which bash
|
|
||||||
bash --version
|
|
||||||
|
|
||||||
- name: List files in the workspace
|
|
||||||
run: ls -lsa
|
|
||||||
|
|
||||||
- name: Run a simple bash script
|
|
||||||
run: |
|
|
||||||
echo "Hello from Gitea Actions!"
|
|
||||||
mkdir -p my_output
|
|
||||||
echo "This was created by a workflow running on the host." > my_output/output.txt
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Run your actual bash code here
|
||||||
|
run: |
|
||||||
|
echo "Current working directory:"
|
||||||
|
pwd
|
||||||
|
echo "Files in workspace:"
|
||||||
|
ls -lsa
|
||||||
|
|
||||||
|
# Example: Create a simple file
|
||||||
|
echo "Hello, Gitea Runner!" > output.txt
|
||||||
|
cat output.txt
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
# - name: Checkout repository manually using bash
|
||||||
|
# run: |
|
||||||
|
# # Ensure the workspace directory is clean and navigate into it
|
||||||
|
# # GITHUB_WORKSPACE is an environment variable set by the runner
|
||||||
|
# cd $GITHUB_WORKSPACE
|
||||||
|
|
||||||
|
# # Authenticate using the GITEA_TOKEN (managed by Gitea Actions)
|
||||||
|
# # GITHUB_SERVER_URL and GITHUB_REPOSITORY are also standard env vars
|
||||||
|
# git clone --depth=1 https://${{ gitea.token }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git .
|
||||||
|
|
||||||
|
# # Optional: checkout a specific pull request head if it's a PR event
|
||||||
|
# # Note: Gitea uses refs/pull/:prNumber/head instead of merge commits for PRs
|
||||||
|
# if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||||
|
# git checkout ${{ github.event.pull_request.head.sha }}
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# - name: Check system info using bash
|
||||||
|
# run: |
|
||||||
|
# echo "Running on the host machine"
|
||||||
|
# uname -a
|
||||||
|
# which bash
|
||||||
|
# bash --version
|
||||||
|
|
||||||
|
# - name: List files in the workspace
|
||||||
|
# run: ls -lsa
|
||||||
|
|
||||||
|
# - name: Run a simple bash script
|
||||||
|
# run: |
|
||||||
|
# echo "Hello from Gitea Actions!"
|
||||||
|
# mkdir -p my_output
|
||||||
|
# echo "This was created by a workflow running on the host." > my_output/output.txt
|
||||||
|
# shell: bash
|
||||||
|
|
||||||
# - name: Checkout repository
|
# - name: Checkout repository
|
||||||
# uses: actions/checkout@v3
|
# uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user