mirror of
https://github.com/actions/runner.git
synced 2025-12-10 12:36:23 +00:00
Compare commits
12 Commits
copilot/fi
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9772a0fb4 | ||
|
|
f8ae5bb1a7 | ||
|
|
a5631456a2 | ||
|
|
65dfa460ba | ||
|
|
80ee51f164 | ||
|
|
c95883f28e | ||
|
|
6e940643a9 | ||
|
|
629f2384a4 | ||
|
|
c3bf70becb | ||
|
|
8b65f5f9df | ||
|
|
5f1efec208 | ||
|
|
20d82ad357 |
@@ -4,7 +4,7 @@
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/docker-in-docker:1": {},
|
||||
"ghcr.io/devcontainers/features/dotnet": {
|
||||
"version": "8.0.412"
|
||||
"version": "8.0.413"
|
||||
},
|
||||
"ghcr.io/devcontainers/features/node:1": {
|
||||
"version": "20"
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -338,7 +338,7 @@ jobs:
|
||||
org.opencontainers.image.licenses=MIT
|
||||
|
||||
- name: Generate attestation
|
||||
uses: actions/attest-build-provenance@v2
|
||||
uses: actions/attest-build-provenance@v3
|
||||
with:
|
||||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
subject-digest: ${{ steps.build-and-push.outputs.digest }}
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
cd src/Misc/expressionFunc/hashFiles
|
||||
|
||||
npx lint-staged
|
||||
cd src/Misc/expressionFunc/hashFiles && npx lint-staged
|
||||
|
||||
31
README.md
31
README.md
@@ -12,33 +12,28 @@ The runner is the application that runs a job from a GitHub Actions workflow. It
|
||||
|
||||
For more information about installing and using self-hosted runners, see [Adding self-hosted runners](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/adding-self-hosted-runners) and [Using self-hosted runners in a workflow](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-self-hosted-runners-in-a-workflow)
|
||||
|
||||
## Download and Install
|
||||
Runner releases:
|
||||
|
||||
 **Windows**: [Prerequisites](docs/start/envwin.md) | [Download](https://github.com/actions/runner/releases)
|
||||
 [Pre-reqs](docs/start/envwin.md) | [Download](https://github.com/actions/runner/releases)
|
||||
|
||||
 **macOS**: [Prerequisites](docs/start/envosx.md) | [Download](https://github.com/actions/runner/releases)
|
||||
 [Pre-reqs](docs/start/envosx.md) | [Download](https://github.com/actions/runner/releases)
|
||||
|
||||
 **Linux**: [Prerequisites](docs/start/envlinux.md) | [Download](https://github.com/actions/runner/releases)
|
||||
 [Pre-reqs](docs/start/envlinux.md) | [Download](https://github.com/actions/runner/releases)
|
||||
|
||||
## Documentation and Resources
|
||||
### Note
|
||||
|
||||
- 📚 **[Complete Documentation Index](docs/README.md)** - Comprehensive guide to all documentation
|
||||
- 📖 **[Contributing Guide](docs/contribute.md)** - Development setup, building, and testing
|
||||
- 🔧 **[Automation Scripts](docs/automate.md)** - Automate runner setup and configuration
|
||||
- 🛠️ **[Troubleshooting Guides](docs/checks/README.md)** - Common issues and solutions
|
||||
- 🏗️ **[Architecture Decision Records](docs/adrs/README.md)** - Important architectural decisions
|
||||
- ⚙️ **Platform Prerequisites:** [Linux](docs/start/envlinux.md) | [Windows](docs/start/envwin.md) | [macOS](docs/start/envosx.md)
|
||||
Thank you for your interest in this GitHub repo, however, right now we are not taking contributions.
|
||||
|
||||
## Support and Community
|
||||
We continue to focus our resources on strategic areas that help our customers be successful while making developers' lives easier. While GitHub Actions remains a key part of this vision, we are allocating resources towards other areas of Actions and are not taking contributions to this repository at this time. The GitHub public roadmap is the best place to follow along for any updates on features we’re working on and what stage they’re in.
|
||||
|
||||
Thank you for your interest in this repository. Please note our current contribution and support guidelines:
|
||||
We are taking the following steps to better direct requests related to GitHub Actions, including:
|
||||
|
||||
**Bug Reports:** You are welcome to report bugs in this repository through Issues.
|
||||
1. We will be directing questions and support requests to our [Community Discussions area](https://github.com/orgs/community/discussions/categories/actions)
|
||||
|
||||
**Feature Requests:** Please submit feature and enhancement requests on the [GitHub Community Discussions](https://github.com/orgs/community/discussions/categories/actions) page.
|
||||
2. High Priority bugs can be reported through Community Discussions or you can report these to our support team https://support.github.com/contact/bug-report.
|
||||
|
||||
**Support Questions:** For help and support, please use our [Community Discussions area](https://github.com/orgs/community/discussions/categories/actions).
|
||||
3. Security Issues should be handled as per our [security.md](security.md)
|
||||
|
||||
**Security Issues:** Please report security vulnerabilities following our [security policy](security.md).
|
||||
We will still provide security updates for this project and fix major breaking changes during this time.
|
||||
|
||||
**High Priority Issues:** Critical bugs can be reported through Community Discussions or our [support team](https://support.github.com/contact/bug-report).
|
||||
You are welcome to still raise bugs in this repo.
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
# GitHub Actions Runner Documentation
|
||||
|
||||
Welcome to the GitHub Actions Runner documentation. This guide will help you get started with self-hosted runners, contribute to the project, and troubleshoot common issues.
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
### Installation and Setup
|
||||
- **[Linux Prerequisites](start/envlinux.md)** - Complete setup guide for Linux systems
|
||||
- **[Windows Prerequisites](start/envwin.md)** - Complete setup guide for Windows systems
|
||||
- **[macOS Prerequisites](start/envosx.md)** - Complete setup guide for macOS systems
|
||||
|
||||
### Quick Start
|
||||
1. Download the [latest runner release](https://github.com/actions/runner/releases)
|
||||
2. Follow the platform-specific prerequisites guide above
|
||||
3. Configure your runner with `./config.sh` (Linux/macOS) or `.\config.cmd` (Windows)
|
||||
4. Start the runner with `./run.sh` (Linux/macOS) or `.\run.cmd` (Windows)
|
||||
|
||||
## 🔧 Administration and Automation
|
||||
|
||||
- **[Automation Scripts](automate.md)** - Automate runner deployment and management
|
||||
- **[Troubleshooting Guides](checks/)** - Common issues and solutions
|
||||
|
||||
## 🏗️ Development and Contributing
|
||||
|
||||
- **[Contributing Guide](contribute.md)** - Development setup, building, and testing
|
||||
- **[Architecture Decision Records](adrs/README.md)** - Important architectural decisions and design patterns
|
||||
|
||||
## 📋 Reference Materials
|
||||
|
||||
### System Checks and Troubleshooting
|
||||
- **[Network Connectivity](checks/network.md)** - Troubleshoot network issues
|
||||
- **[Git Configuration](checks/git.md)** - Git-related problems
|
||||
- **[Actions Troubleshooting](checks/actions.md)** - Action-specific issues
|
||||
- **[SSL Certificate Issues](checks/sslcert.md)** - Certificate and TLS problems
|
||||
- **[Node.js Issues](checks/nodejs.md)** - Node.js runtime problems
|
||||
- **[Internet Connectivity](checks/internet.md)** - General connectivity issues
|
||||
|
||||
### Development Resources
|
||||
- **[Visual Studio Code Setup](contribute/vscode.md)** - IDE configuration for development
|
||||
- **[Design Documentation](design/)** - Technical design documents
|
||||
|
||||
## 🆘 Getting Help
|
||||
|
||||
### Community Support
|
||||
- **[GitHub Community Discussions](https://github.com/orgs/community/discussions/categories/actions)** - Ask questions and get help from the community
|
||||
- **[GitHub Support](https://support.github.com/contact/bug-report)** - Report critical bugs or get professional support
|
||||
|
||||
### Reporting Issues
|
||||
- **Bug Reports**: Open an issue in this repository
|
||||
- **Feature Requests**: Use [GitHub Community Discussions](https://github.com/orgs/community/discussions/categories/actions-and-packages)
|
||||
- **Security Issues**: Follow our [security policy](../security.md)
|
||||
|
||||
## 📖 Additional Resources
|
||||
|
||||
- **[GitHub Actions Documentation](https://docs.github.com/en/actions)** - Official GitHub Actions documentation
|
||||
- **[Self-hosted Runners Guide](https://docs.github.com/en/actions/hosting-your-own-runners)** - GitHub's official self-hosted runner documentation
|
||||
- **[Runner Releases](https://github.com/actions/runner/releases)** - Download the latest runner versions
|
||||
|
||||
---
|
||||
|
||||
> **Note**: This documentation is maintained by the GitHub Actions team and the community. If you find any issues or have suggestions for improvement, please open an issue or contribute a pull request.
|
||||
@@ -76,76 +76,3 @@ Repo level one-liner. NOTE: replace with yourorg/yourrepo (repo level) or just
|
||||
```bash
|
||||
curl -s https://raw.githubusercontent.com/actions/runner/main/scripts/delete.sh | bash -s yourorg/yourrepo runnername
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
#### Permission Denied
|
||||
```bash
|
||||
# Ensure scripts have execute permissions
|
||||
chmod +x ./config.sh ./run.sh
|
||||
```
|
||||
|
||||
#### PAT Token Issues
|
||||
```bash
|
||||
# Verify your PAT has the correct scopes:
|
||||
# - repo (for repository-level runners)
|
||||
# - admin:org (for organization-level runners)
|
||||
export RUNNER_CFG_PAT=your_token_here
|
||||
echo $RUNNER_CFG_PAT # Verify it's set
|
||||
```
|
||||
|
||||
#### Network Connectivity
|
||||
```bash
|
||||
# Test GitHub connectivity
|
||||
curl -H "Authorization: token $RUNNER_CFG_PAT" https://api.github.com/user
|
||||
|
||||
# For GitHub Enterprise Server
|
||||
curl -H "Authorization: token $RUNNER_CFG_PAT" https://your-github-enterprise/api/v3/user
|
||||
```
|
||||
|
||||
#### Service Installation Fails
|
||||
```bash
|
||||
# Check if running as appropriate user
|
||||
whoami
|
||||
|
||||
# For Linux - ensure systemd is available
|
||||
systemctl --version
|
||||
|
||||
# For macOS - ensure launchd is available
|
||||
launchctl version
|
||||
```
|
||||
|
||||
#### Runner Registration Fails
|
||||
```bash
|
||||
# Check if runner already exists
|
||||
curl -H "Authorization: token $RUNNER_CFG_PAT" \
|
||||
"https://api.github.com/repos/OWNER/REPO/actions/runners"
|
||||
|
||||
# Remove existing runner if needed
|
||||
./config.sh remove --token $RUNNER_CFG_PAT
|
||||
```
|
||||
|
||||
### Getting Help
|
||||
|
||||
- **Configuration Issues**: Check the [Prerequisites](start/envlinux.md) for your platform
|
||||
- **Network Problems**: Review [network troubleshooting guide](checks/network.md)
|
||||
- **General Support**: Visit [GitHub Community Discussions](https://github.com/orgs/community/discussions/categories/actions)
|
||||
|
||||
### Advanced Examples
|
||||
|
||||
#### Organization-level Runner with Custom Labels
|
||||
```bash
|
||||
export RUNNER_CFG_PAT=your_org_pat
|
||||
curl -s https://raw.githubusercontent.com/actions/runner/main/scripts/create-latest-svc.sh | \
|
||||
bash -s -- -s myorg -n prod-runner-1 -l production,linux,docker
|
||||
```
|
||||
|
||||
#### Repository-level Runner for GitHub Enterprise
|
||||
```bash
|
||||
export RUNNER_CFG_PAT=your_ghe_pat
|
||||
curl -s https://raw.githubusercontent.com/actions/runner/main/scripts/create-latest-svc.sh | \
|
||||
bash -s -- -s myorg/myrepo -g github.company.com -n build-server -u builder
|
||||
```
|
||||
```
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
# Troubleshooting Guides
|
||||
|
||||
This directory contains troubleshooting guides for common issues you might encounter when setting up or running GitHub Actions self-hosted runners.
|
||||
|
||||
## Quick Reference
|
||||
|
||||
| Issue Type | Guide | Description |
|
||||
|------------|-------|-------------|
|
||||
| 🌐 **Network** | [network.md](network.md) | Connection issues, proxy, firewall problems |
|
||||
| 🔒 **SSL/TLS** | [sslcert.md](sslcert.md) | Certificate and TLS handshake issues |
|
||||
| 📦 **Git** | [git.md](git.md) | Git configuration and repository access |
|
||||
| ⚡ **Actions** | [actions.md](actions.md) | Action-specific runtime issues |
|
||||
| 🟢 **Node.js** | [nodejs.md](nodejs.md) | Node.js runtime and npm issues |
|
||||
| 🌍 **Internet** | [internet.md](internet.md) | General internet connectivity |
|
||||
|
||||
## Common First Steps
|
||||
|
||||
Before diving into specific guides, try these general troubleshooting steps:
|
||||
|
||||
### 1. Check Basic Connectivity
|
||||
```bash
|
||||
# Test GitHub API access
|
||||
curl -I https://api.github.com/
|
||||
|
||||
# For GitHub Enterprise Server
|
||||
curl -I https://your-github-enterprise.com/api/v3/
|
||||
```
|
||||
|
||||
### 2. Verify Runner Status
|
||||
```bash
|
||||
# Check if runner service is running
|
||||
./svc.sh status
|
||||
|
||||
# View recent logs
|
||||
tail -f _diag/Runner_*.log
|
||||
```
|
||||
|
||||
### 3. Test Runner Configuration
|
||||
```bash
|
||||
# Re-run configuration
|
||||
./config.sh
|
||||
|
||||
# Test connection without running
|
||||
./run.sh --check
|
||||
```
|
||||
|
||||
## Getting Additional Help
|
||||
|
||||
If these guides don't resolve your issue:
|
||||
|
||||
1. **Search existing issues** in the [runner repository](https://github.com/actions/runner/issues)
|
||||
2. **Check GitHub Status** at [githubstatus.com](https://githubstatus.com)
|
||||
3. **Ask the community** in [GitHub Community Discussions](https://github.com/orgs/community/discussions/categories/actions)
|
||||
4. **Contact support** for critical issues via [GitHub Support](https://support.github.com/contact)
|
||||
|
||||
## Contributing
|
||||
|
||||
Found a solution to a common problem not covered here? Consider contributing:
|
||||
|
||||
1. Create a new `.md` file for the issue type
|
||||
2. Follow the format of existing guides
|
||||
3. Submit a pull request with your improvements
|
||||
|
||||
---
|
||||
|
||||
💡 **Tip**: Always check the `_diag/` directory for detailed log files when troubleshooting issues.
|
||||
@@ -1,24 +1,5 @@
|
||||
# Contributions
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Issues](#issues)
|
||||
- [Enhancements and Feature Requests](#enhancements-and-feature-requests)
|
||||
- [Required Dev Dependencies](#required-dev-dependencies)
|
||||
- [Quickstart: Run a Job from a Real Repository](#quickstart-run-a-job-from-a-real-repository)
|
||||
- [Development Life Cycle](#development-life-cycle)
|
||||
- [Clone Repository](#clone-repository)
|
||||
- [Build Layout](#build-layout)
|
||||
- [Test Layout](#test-layout)
|
||||
- [Configure Runner](#configure-runner)
|
||||
- [Run Runner](#run-runner)
|
||||
- [View Logs](#view-logs)
|
||||
- [Editors](#editors)
|
||||
- [Styling](#styling)
|
||||
|
||||
## Getting Started
|
||||
|
||||
We welcome contributions in the form of issues and pull requests. We view the contributions and the process as the same for github and external contributors. Please note the runner typically requires changes across the entire system and we aim for issues in the runner to be entirely self contained and fixable here. Therefore, we will primarily handle bug issues opened in this repo and we kindly request you to create all feature and enhancement requests on the [GitHub Feedback](https://github.com/community/community/discussions/categories/actions-and-packages) page.
|
||||
|
||||
> IMPORTANT: Building your own runner is critical for the dev inner loop process when contributing changes. However, only runners built and distributed by GitHub (releases) are supported in production. Be aware that workflows and orchestrations run service side with the runner being a remote process to run steps. For that reason, the service can pull the runner forward so customizations can be lost.
|
||||
@@ -143,8 +124,8 @@ cd runner/_layout
|
||||
./config.(sh/cmd) # configure your custom runner
|
||||
```
|
||||
|
||||
You will need the name of your repository and a runner registration token.
|
||||
Check the [Quickstart section](#quickstart-run-a-job-from-a-real-repository) if you don't know how to get this token.
|
||||
You will need your the name of your repository and a runner registration token.
|
||||
Check [Quickstart](##Quickstart:-Run-a-job-from-a-real-repository) if you don't know how to get this token.
|
||||
|
||||
These can also be passed down as arguments to `config.(sh/cmd)`:
|
||||
```bash
|
||||
|
||||
@@ -6,21 +6,10 @@
|
||||
|
||||
Please see "[Supported architectures and operating systems for self-hosted runners](https://docs.github.com/en/actions/reference/runners/self-hosted-runners#linux)."
|
||||
|
||||
## Quick Setup
|
||||
|
||||
The `./config.sh` script will automatically check and guide you through installing .NET dependencies:
|
||||
|
||||
```bash
|
||||
./config.sh
|
||||
# If dependencies are missing, run:
|
||||
./bin/installdependencies.sh
|
||||
```
|
||||
|
||||
## Install .NET Core Linux Dependencies
|
||||
|
||||
The `./config.sh` will check .NET Core dependencies during runner configuration.
|
||||
You might see something like this which indicates a dependency is missing:
|
||||
## Install .Net Core 3.x Linux Dependencies
|
||||
|
||||
The `./config.sh` will check .Net Core 3.x dependencies during runner configuration.
|
||||
You might see something like this which indicate a dependency's missing.
|
||||
```bash
|
||||
./config.sh
|
||||
libunwind.so.8 => not found
|
||||
@@ -28,87 +17,34 @@ You might see something like this which indicates a dependency is missing:
|
||||
Dependencies is missing for Dotnet Core 6.0
|
||||
Execute ./bin/installdependencies.sh to install any missing Dotnet Core 6.0 dependencies.
|
||||
```
|
||||
|
||||
You can easily correct the problem by executing `./bin/installdependencies.sh`.
|
||||
The `installdependencies.sh` script should install all required dependencies on all supported Linux versions
|
||||
> Note: The `installdependencies.sh` script will try to use the default package management mechanism on your Linux flavor (ex. `yum`/`apt-get`/`apt`).
|
||||
|
||||
> **Note:** The `installdependencies.sh` script will try to use the default package management mechanism on your Linux flavor (ex. `yum`/`apt-get`/`apt`).
|
||||
### Full dependencies list
|
||||
|
||||
## Manual Dependency Installation
|
||||
Debian based OS (Debian, Ubuntu, Linux Mint)
|
||||
|
||||
If the automatic installation doesn't work, you can manually install dependencies using your package manager:
|
||||
|
||||
### Debian based OS (Debian, Ubuntu, Linux Mint)
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y liblttng-ust1 libkrb5-3 zlib1g libssl1.1 libicu66
|
||||
```
|
||||
|
||||
**Required packages:**
|
||||
- liblttng-ust1 or liblttng-ust0
|
||||
- libkrb5-3
|
||||
- zlib1g
|
||||
- libssl1.1, libssl1.0.2 or libssl1.0.0
|
||||
- libicu63, libicu60, libicu57 or libicu55
|
||||
|
||||
### Fedora based OS (Fedora, Red Hat Enterprise Linux, CentOS, Oracle Linux 7)
|
||||
Fedora based OS (Fedora, Red Hat Enterprise Linux, CentOS, Oracle Linux 7)
|
||||
|
||||
```bash
|
||||
sudo yum install -y lttng-ust openssl-libs krb5-libs zlib libicu
|
||||
# Or for newer systems:
|
||||
sudo dnf install -y lttng-ust openssl-libs krb5-libs zlib libicu
|
||||
```
|
||||
|
||||
**Required packages:**
|
||||
- lttng-ust
|
||||
- openssl-libs
|
||||
- krb5-libs
|
||||
- zlib
|
||||
- libicu
|
||||
|
||||
### SUSE based OS (OpenSUSE, SUSE Enterprise)
|
||||
SUSE based OS (OpenSUSE, SUSE Enterprise)
|
||||
|
||||
```bash
|
||||
sudo zypper install -y lttng-ust libopenssl1_1 krb5 zlib libicu60_2
|
||||
```
|
||||
|
||||
**Required packages:**
|
||||
- lttng-ust
|
||||
- libopenssl1_1
|
||||
- krb5
|
||||
- zlib
|
||||
- libicu60_2
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Permission denied errors:**
|
||||
```bash
|
||||
sudo chmod +x ./config.sh ./run.sh
|
||||
```
|
||||
|
||||
**Missing dependencies after installation:**
|
||||
```bash
|
||||
# Check what's missing
|
||||
ldd ./bin/Runner.Listener
|
||||
# Reinstall dependencies
|
||||
./bin/installdependencies.sh
|
||||
```
|
||||
|
||||
**SSL/TLS errors:**
|
||||
```bash
|
||||
# Update certificates
|
||||
sudo apt-get update && sudo apt-get install ca-certificates
|
||||
# Or for RHEL/CentOS:
|
||||
sudo yum update ca-certificates
|
||||
```
|
||||
|
||||
### Getting Help
|
||||
|
||||
- Check our [troubleshooting guide](../checks/README.md)
|
||||
- Search [GitHub Community Discussions](https://github.com/orgs/community/discussions/categories/actions)
|
||||
- Review [common network issues](../checks/network.md)
|
||||
|
||||
## [More .NET Core Prerequisites Information](https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x)
|
||||
## [More .Net Core Prerequisites Information](https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x)
|
||||
|
||||
@@ -1,136 +1,9 @@
|
||||
|
||||
|
||||
#  macOS System Prerequisites
|
||||
#  macOS/OS X System Prerequisites
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Please see "[Supported architectures and operating systems for self-hosted runners](https://docs.github.com/en/actions/reference/runners/self-hosted-runners#macos)."
|
||||
|
||||
## Quick Setup
|
||||
|
||||
1. **Download** the latest runner from [releases](https://github.com/actions/runner/releases)
|
||||
2. **Extract** the downloaded archive: `tar xzf actions-runner-osx-x64-*.tar.gz`
|
||||
3. **Run** `./config.sh` to configure the runner
|
||||
4. **Install** as a service: `sudo ./svc.sh install` and `sudo ./svc.sh start`
|
||||
|
||||
## System Requirements
|
||||
|
||||
### macOS Version
|
||||
- macOS 10.15 (Catalina) or later
|
||||
- Both Intel (x64) and Apple Silicon (ARM64) are supported
|
||||
|
||||
### Required Tools
|
||||
|
||||
#### Homebrew (Recommended)
|
||||
Install Homebrew for easy package management:
|
||||
```bash
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
```
|
||||
|
||||
#### Development Tools
|
||||
```bash
|
||||
# Install Xcode Command Line Tools
|
||||
xcode-select --install
|
||||
|
||||
# Install essential development tools via Homebrew
|
||||
brew install git curl wget
|
||||
```
|
||||
|
||||
### .NET Runtime
|
||||
- .NET 6.0 runtime (automatically included with the runner)
|
||||
|
||||
## Setup Steps
|
||||
|
||||
### 1. Download and Extract
|
||||
```bash
|
||||
# Create runner directory
|
||||
mkdir ~/actions-runner && cd ~/actions-runner
|
||||
|
||||
# Download latest release (replace with actual version)
|
||||
curl -O -L https://github.com/actions/runner/releases/download/v2.xyz.z/actions-runner-osx-x64-2.xyz.z.tar.gz
|
||||
|
||||
# Extract
|
||||
tar xzf ./actions-runner-osx-x64-2.xyz.z.tar.gz
|
||||
```
|
||||
|
||||
### 2. Configure
|
||||
```bash
|
||||
./config.sh --url https://github.com/YOUR_ORG/YOUR_REPO --token YOUR_TOKEN
|
||||
```
|
||||
|
||||
### 3. Run as Service (macOS)
|
||||
```bash
|
||||
# Install as launchd service
|
||||
sudo ./svc.sh install
|
||||
|
||||
# Start the service
|
||||
sudo ./svc.sh start
|
||||
|
||||
# Check status
|
||||
sudo ./svc.sh status
|
||||
```
|
||||
|
||||
### 4. Run Interactively (Alternative)
|
||||
```bash
|
||||
./run.sh
|
||||
```
|
||||
|
||||
## macOS-Specific Considerations
|
||||
|
||||
### Security & Privacy
|
||||
- Allow the runner executable through macOS Gatekeeper
|
||||
- Grant necessary permissions in System Preferences > Security & Privacy
|
||||
|
||||
### Code Signing
|
||||
For repositories that build macOS applications:
|
||||
```bash
|
||||
# Install certificates for code signing
|
||||
security import developer_certificates.p12 -k ~/Library/Keychains/login.keychain
|
||||
```
|
||||
|
||||
### Xcode Integration
|
||||
If building iOS/macOS apps:
|
||||
```bash
|
||||
# Install Xcode from App Store or developer portal
|
||||
# Set Xcode path
|
||||
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Permission Denied:**
|
||||
```bash
|
||||
chmod +x ./config.sh ./run.sh ./svc.sh
|
||||
```
|
||||
|
||||
**Gatekeeper Issues:**
|
||||
```bash
|
||||
# Allow unsigned binary to run
|
||||
sudo spctl --master-disable
|
||||
# Or specifically allow the runner
|
||||
sudo spctl --add ./bin/Runner.Listener
|
||||
```
|
||||
|
||||
**Service Not Starting:**
|
||||
```bash
|
||||
# Check system logs
|
||||
sudo ./svc.sh status
|
||||
tail -f ~/Library/Logs/Runner_*.log
|
||||
```
|
||||
|
||||
**Path Issues:**
|
||||
```bash
|
||||
# Ensure proper PATH in your shell profile
|
||||
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.zshrc
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
### Getting Help
|
||||
|
||||
- Check our [troubleshooting guide](../checks/README.md)
|
||||
- Review [common network issues](../checks/network.md)
|
||||
- Search [GitHub Community Discussions](https://github.com/orgs/community/discussions/categories/actions)
|
||||
|
||||
## [More .NET Prerequisites Information](https://docs.microsoft.com/en-us/dotnet/core/macos-prerequisites?tabs=netcore30)
|
||||
## [More .Net Core Prerequisites Information](https://docs.microsoft.com/en-us/dotnet/core/macos-prerequisites?tabs=netcore30)
|
||||
|
||||
@@ -4,92 +4,4 @@
|
||||
|
||||
Please see "[Supported architectures and operating systems for self-hosted runners](https://docs.github.com/en/actions/reference/runners/self-hosted-runners#windows)."
|
||||
|
||||
## Quick Setup
|
||||
|
||||
1. **Download** the latest runner from [releases](https://github.com/actions/runner/releases)
|
||||
2. **Extract** the downloaded archive to your desired directory
|
||||
3. **Run** `config.cmd` as Administrator to configure the runner
|
||||
4. **Install** as a service (optional): `svc.sh install` and `svc.sh start`
|
||||
|
||||
## System Requirements
|
||||
|
||||
### .NET Runtime
|
||||
- .NET 6.0 runtime (automatically installed with the runner)
|
||||
- Windows PowerShell 5.1 or PowerShell Core 6.0+
|
||||
|
||||
### Windows Features
|
||||
Windows runners require the following components:
|
||||
|
||||
```powershell
|
||||
# Enable required Windows features (run as Administrator)
|
||||
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
|
||||
```
|
||||
|
||||
### Visual Studio Build Tools (For builds requiring compilation)
|
||||
For repositories that need to compile code, install:
|
||||
|
||||
- **Visual Studio 2017 or newer** [Install here](https://visualstudio.microsoft.com)
|
||||
- **Visual Studio 2022 17.3 Preview or later** (for ARM64) [Install here](https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview)
|
||||
|
||||
### Git for Windows
|
||||
- **Git for Windows** [Install here](https://git-scm.com/downloads) (required for repository operations)
|
||||
|
||||
## Common Setup Steps
|
||||
|
||||
### 1. Create Runner Directory
|
||||
```cmd
|
||||
mkdir C:\actions-runner
|
||||
cd C:\actions-runner
|
||||
```
|
||||
|
||||
### 2. Download and Extract
|
||||
```powershell
|
||||
# Download latest release
|
||||
Invoke-WebRequest -Uri "https://github.com/actions/runner/releases/download/v2.xyz.z/actions-runner-win-x64-2.xyz.z.zip" -OutFile "actions-runner.zip"
|
||||
# Extract
|
||||
Expand-Archive -Path "actions-runner.zip" -DestinationPath "."
|
||||
```
|
||||
|
||||
### 3. Configure
|
||||
```cmd
|
||||
.\config.cmd --url https://github.com/YOUR_ORG/YOUR_REPO --token YOUR_TOKEN
|
||||
```
|
||||
|
||||
### 4. Run as Service
|
||||
```cmd
|
||||
# Install service
|
||||
.\svc.sh install
|
||||
# Start service
|
||||
.\svc.sh start
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**PowerShell Execution Policy:**
|
||||
```powershell
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
||||
```
|
||||
|
||||
**Windows Defender/Antivirus:**
|
||||
- Add runner directory to antivirus exclusions
|
||||
- Exclude `Runner.Listener.exe` and `Runner.Worker.exe`
|
||||
|
||||
**Firewall Issues:**
|
||||
```powershell
|
||||
# Allow runner through Windows Firewall
|
||||
New-NetFirewallRule -DisplayName "GitHub Actions Runner" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
|
||||
```
|
||||
|
||||
**Permission Issues:**
|
||||
- Run `config.cmd` as Administrator
|
||||
- Ensure the runner user has "Log on as a service" rights
|
||||
|
||||
### Getting Help
|
||||
|
||||
- Check our [troubleshooting guide](../checks/README.md)
|
||||
- Review [common issues](../checks/actions.md)
|
||||
- Search [GitHub Community Discussions](https://github.com/orgs/community/discussions/categories/actions)
|
||||
|
||||
## [More .NET Prerequisites Information](https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore30)
|
||||
## [More .NET Core Prerequisites Information](https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore30)
|
||||
|
||||
@@ -5,8 +5,8 @@ ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG RUNNER_VERSION
|
||||
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.7.0
|
||||
ARG DOCKER_VERSION=28.3.2
|
||||
ARG BUILDX_VERSION=0.26.1
|
||||
ARG DOCKER_VERSION=28.3.3
|
||||
ARG BUILDX_VERSION=0.27.0
|
||||
|
||||
RUN apt update -y && apt install curl unzip -y
|
||||
|
||||
|
||||
5392
src/Misc/expressionFunc/hashFiles/package-lock.json
generated
5392
src/Misc/expressionFunc/hashFiles/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,7 @@
|
||||
"lint": "eslint src/**/*.ts",
|
||||
"pack": "ncc build -o ../../layoutbin/hashFiles",
|
||||
"all": "npm run format && npm run lint && npm run build && npm run pack",
|
||||
"prepare": "cd ../../../../ && husky install"
|
||||
"prepare": "cd ../../../../ && husky"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -36,15 +36,15 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.6.2",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.7.2",
|
||||
"@vercel/ncc": "^0.38.0",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"eslint": "^8.47.0",
|
||||
"eslint-plugin-github": "^4.10.0",
|
||||
"eslint-plugin-github": "^6.0.0",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"husky": "^8.0.3",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^15.5.0",
|
||||
"prettier": "^3.0.3",
|
||||
"typescript": "^5.2.2"
|
||||
"typescript": "^5.9.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
SECONDS=0
|
||||
while [[ $SECONDS != $1 ]]; do
|
||||
while [[ $SECONDS -lt $1 ]]; do
|
||||
:
|
||||
done
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace GitHub.Runner.Common
|
||||
|
||||
Task<TaskAgentMessage> GetRunnerMessageAsync(Guid? sessionId, TaskAgentStatus status, string version, string os, string architecture, bool disableUpdate, CancellationToken token);
|
||||
|
||||
Task AcknowledgeRunnerRequestAsync(string runnerRequestId, Guid? sessionId, TaskAgentStatus status, string version, string os, string architecture, CancellationToken token);
|
||||
|
||||
Task UpdateConnectionIfNeeded(Uri serverUri, VssCredentials credentials);
|
||||
|
||||
Task ForceRefreshConnection(VssCredentials credentials);
|
||||
@@ -67,10 +69,17 @@ namespace GitHub.Runner.Common
|
||||
var brokerSession = RetryRequest<TaskAgentMessage>(
|
||||
async () => await _brokerHttpClient.GetRunnerMessageAsync(sessionId, version, status, os, architecture, disableUpdate, cancellationToken), cancellationToken, shouldRetry: ShouldRetryException);
|
||||
|
||||
|
||||
return brokerSession;
|
||||
}
|
||||
|
||||
public async Task AcknowledgeRunnerRequestAsync(string runnerRequestId, Guid? sessionId, TaskAgentStatus status, string version, string os, string architecture, CancellationToken cancellationToken)
|
||||
{
|
||||
CheckConnection();
|
||||
|
||||
// No retries
|
||||
await _brokerHttpClient.AcknowledgeRunnerRequestAsync(runnerRequestId, sessionId, version, status, os, architecture, cancellationToken);
|
||||
}
|
||||
|
||||
public async Task DeleteSessionAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
CheckConnection();
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace GitHub.Runner.Common
|
||||
|
||||
protected async Task RetryRequest(Func<Task> func,
|
||||
CancellationToken cancellationToken,
|
||||
int maxRetryAttemptsCount = 5,
|
||||
int maxAttempts = 5,
|
||||
Func<Exception, bool> shouldRetry = null
|
||||
)
|
||||
{
|
||||
@@ -79,31 +79,31 @@ namespace GitHub.Runner.Common
|
||||
await func();
|
||||
return Unit.Value;
|
||||
}
|
||||
await RetryRequest<Unit>(wrappedFunc, cancellationToken, maxRetryAttemptsCount, shouldRetry);
|
||||
await RetryRequest<Unit>(wrappedFunc, cancellationToken, maxAttempts, shouldRetry);
|
||||
}
|
||||
|
||||
protected async Task<T> RetryRequest<T>(Func<Task<T>> func,
|
||||
CancellationToken cancellationToken,
|
||||
int maxRetryAttemptsCount = 5,
|
||||
int maxAttempts = 5,
|
||||
Func<Exception, bool> shouldRetry = null
|
||||
)
|
||||
{
|
||||
var retryCount = 0;
|
||||
var attempt = 0;
|
||||
while (true)
|
||||
{
|
||||
retryCount++;
|
||||
attempt++;
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
try
|
||||
{
|
||||
return await func();
|
||||
}
|
||||
// TODO: Add handling of non-retriable exceptions: https://github.com/github/actions-broker/issues/122
|
||||
catch (Exception ex) when (retryCount < maxRetryAttemptsCount && (shouldRetry == null || shouldRetry(ex)))
|
||||
catch (Exception ex) when (attempt < maxAttempts && (shouldRetry == null || shouldRetry(ex)))
|
||||
{
|
||||
Trace.Error("Catch exception during request");
|
||||
Trace.Error(ex);
|
||||
var backOff = BackoffTimerHelper.GetRandomBackoff(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(15));
|
||||
Trace.Warning($"Back off {backOff.TotalSeconds} seconds before next retry. {maxRetryAttemptsCount - retryCount} attempt left.");
|
||||
Trace.Warning($"Back off {backOff.TotalSeconds} seconds before next retry. {maxAttempts - attempt} attempt left.");
|
||||
await Task.Delay(backOff, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace GitHub.Runner.Listener
|
||||
private RunnerSettings _settings;
|
||||
private ITerminal _term;
|
||||
private TimeSpan _getNextMessageRetryInterval;
|
||||
private TaskAgentStatus runnerStatus = TaskAgentStatus.Online;
|
||||
private TaskAgentStatus _runnerStatus = TaskAgentStatus.Online;
|
||||
private CancellationTokenSource _getMessagesTokenSource;
|
||||
private VssCredentials _creds;
|
||||
private VssCredentials _credsV2;
|
||||
@@ -258,7 +258,7 @@ namespace GitHub.Runner.Listener
|
||||
public void OnJobStatus(object sender, JobStatusEventArgs e)
|
||||
{
|
||||
Trace.Info("Received job status event. JobState: {0}", e.Status);
|
||||
runnerStatus = e.Status;
|
||||
_runnerStatus = e.Status;
|
||||
try
|
||||
{
|
||||
_getMessagesTokenSource?.Cancel();
|
||||
@@ -291,7 +291,7 @@ namespace GitHub.Runner.Listener
|
||||
}
|
||||
|
||||
message = await _brokerServer.GetRunnerMessageAsync(_session.SessionId,
|
||||
runnerStatus,
|
||||
_runnerStatus,
|
||||
BuildConstants.RunnerPackage.Version,
|
||||
VarUtil.OS,
|
||||
VarUtil.OSArchitecture,
|
||||
@@ -417,6 +417,21 @@ namespace GitHub.Runner.Listener
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task AcknowledgeMessageAsync(string runnerRequestId, CancellationToken cancellationToken)
|
||||
{
|
||||
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); // Short timeout
|
||||
using var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
|
||||
Trace.Info($"Acknowledging runner request '{runnerRequestId}'.");
|
||||
await _brokerServer.AcknowledgeRunnerRequestAsync(
|
||||
runnerRequestId,
|
||||
_session.SessionId,
|
||||
_runnerStatus,
|
||||
BuildConstants.RunnerPackage.Version,
|
||||
VarUtil.OS,
|
||||
VarUtil.OSArchitecture,
|
||||
linkedCts.Token);
|
||||
}
|
||||
|
||||
private bool IsGetNextMessageExceptionRetriable(Exception ex)
|
||||
{
|
||||
if (ex is TaskAgentNotFoundException ||
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace GitHub.Runner.Listener
|
||||
Task DeleteSessionAsync();
|
||||
Task<TaskAgentMessage> GetNextMessageAsync(CancellationToken token);
|
||||
Task DeleteMessageAsync(TaskAgentMessage message);
|
||||
Task AcknowledgeMessageAsync(string runnerRequestId, CancellationToken cancellationToken);
|
||||
|
||||
Task RefreshListenerTokenAsync();
|
||||
void OnJobStatus(object sender, JobStatusEventArgs e);
|
||||
@@ -52,7 +53,7 @@ namespace GitHub.Runner.Listener
|
||||
private readonly TimeSpan _sessionConflictRetryLimit = TimeSpan.FromMinutes(4);
|
||||
private readonly TimeSpan _clockSkewRetryLimit = TimeSpan.FromMinutes(30);
|
||||
private readonly Dictionary<string, int> _sessionCreationExceptionTracker = new();
|
||||
private TaskAgentStatus runnerStatus = TaskAgentStatus.Online;
|
||||
private TaskAgentStatus _runnerStatus = TaskAgentStatus.Online;
|
||||
private CancellationTokenSource _getMessagesTokenSource;
|
||||
private VssCredentials _creds;
|
||||
private VssCredentials _credsV2;
|
||||
@@ -217,7 +218,7 @@ namespace GitHub.Runner.Listener
|
||||
public void OnJobStatus(object sender, JobStatusEventArgs e)
|
||||
{
|
||||
Trace.Info("Received job status event. JobState: {0}", e.Status);
|
||||
runnerStatus = e.Status;
|
||||
_runnerStatus = e.Status;
|
||||
try
|
||||
{
|
||||
_getMessagesTokenSource?.Cancel();
|
||||
@@ -250,7 +251,7 @@ namespace GitHub.Runner.Listener
|
||||
message = await _runnerServer.GetAgentMessageAsync(_settings.PoolId,
|
||||
_session.SessionId,
|
||||
_lastMessageId,
|
||||
runnerStatus,
|
||||
_runnerStatus,
|
||||
BuildConstants.RunnerPackage.Version,
|
||||
VarUtil.OS,
|
||||
VarUtil.OSArchitecture,
|
||||
@@ -274,7 +275,7 @@ namespace GitHub.Runner.Listener
|
||||
}
|
||||
|
||||
message = await _brokerServer.GetRunnerMessageAsync(_session.SessionId,
|
||||
runnerStatus,
|
||||
_runnerStatus,
|
||||
BuildConstants.RunnerPackage.Version,
|
||||
VarUtil.OS,
|
||||
VarUtil.OSArchitecture,
|
||||
@@ -437,6 +438,21 @@ namespace GitHub.Runner.Listener
|
||||
await _brokerServer.ForceRefreshConnection(_credsV2);
|
||||
}
|
||||
|
||||
public async Task AcknowledgeMessageAsync(string runnerRequestId, CancellationToken cancellationToken)
|
||||
{
|
||||
using var timeoutCts = new CancellationTokenSource(TimeSpan.FromSeconds(5)); // Short timeout
|
||||
using var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, timeoutCts.Token);
|
||||
Trace.Info($"Acknowledging runner request '{runnerRequestId}'.");
|
||||
await _brokerServer.AcknowledgeRunnerRequestAsync(
|
||||
runnerRequestId,
|
||||
_session.SessionId,
|
||||
_runnerStatus,
|
||||
BuildConstants.RunnerPackage.Version,
|
||||
VarUtil.OS,
|
||||
VarUtil.OSArchitecture,
|
||||
linkedCts.Token);
|
||||
}
|
||||
|
||||
private TaskAgentMessage DecryptMessage(TaskAgentMessage message)
|
||||
{
|
||||
if (_session.EncryptionKey == null ||
|
||||
|
||||
@@ -654,22 +654,42 @@ namespace GitHub.Runner.Listener
|
||||
else
|
||||
{
|
||||
var messageRef = StringUtil.ConvertFromJson<RunnerJobRequestRef>(message.Body);
|
||||
Pipelines.AgentJobRequestMessage jobRequestMessage = null;
|
||||
|
||||
// Create connection
|
||||
var credMgr = HostContext.GetService<ICredentialManager>();
|
||||
// Acknowledge (best-effort)
|
||||
if (messageRef.ShouldAcknowledge) // Temporary feature flag
|
||||
{
|
||||
try
|
||||
{
|
||||
await _listener.AcknowledgeMessageAsync(messageRef.RunnerRequestId, messageQueueLoopTokenSource.Token);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Trace.Error($"Best-effort acknowledge failed for request '{messageRef.RunnerRequestId}'");
|
||||
Trace.Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
Pipelines.AgentJobRequestMessage jobRequestMessage = null;
|
||||
if (string.IsNullOrEmpty(messageRef.RunServiceUrl))
|
||||
{
|
||||
// Connect
|
||||
var credMgr = HostContext.GetService<ICredentialManager>();
|
||||
var creds = credMgr.LoadCredentials(allowAuthUrlV2: false);
|
||||
var actionsRunServer = HostContext.CreateService<IActionsRunServer>();
|
||||
await actionsRunServer.ConnectAsync(new Uri(settings.ServerUrl), creds);
|
||||
|
||||
// Get job message
|
||||
jobRequestMessage = await actionsRunServer.GetJobMessageAsync(messageRef.RunnerRequestId, messageQueueLoopTokenSource.Token);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Connect
|
||||
var credMgr = HostContext.GetService<ICredentialManager>();
|
||||
var credsV2 = credMgr.LoadCredentials(allowAuthUrlV2: true);
|
||||
var runServer = HostContext.CreateService<IRunServer>();
|
||||
await runServer.ConnectAsync(new Uri(messageRef.RunServiceUrl), credsV2);
|
||||
|
||||
// Get job message
|
||||
try
|
||||
{
|
||||
jobRequestMessage = await runServer.GetJobMessageAsync(messageRef.RunnerRequestId, messageRef.BillingOwnerId, messageQueueLoopTokenSource.Token);
|
||||
@@ -698,7 +718,10 @@ namespace GitHub.Runner.Listener
|
||||
}
|
||||
}
|
||||
|
||||
// Dispatch
|
||||
jobDispatcher.Run(jobRequestMessage, runOnce);
|
||||
|
||||
// Run once?
|
||||
if (runOnce)
|
||||
{
|
||||
Trace.Info("One time used runner received job message.");
|
||||
|
||||
@@ -10,6 +10,9 @@ namespace GitHub.Runner.Listener
|
||||
|
||||
[DataMember(Name = "runner_request_id")]
|
||||
public string RunnerRequestId { get; set; }
|
||||
|
||||
[DataMember(Name = "should_acknowledge")]
|
||||
public bool ShouldAcknowledge { get; set; }
|
||||
|
||||
[DataMember(Name = "run_service_url")]
|
||||
public string RunServiceUrl { get; set; }
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace GitHub.Actions.RunService.WebApi
|
||||
{
|
||||
queryParams.Add("status", status.Value.ToString());
|
||||
}
|
||||
|
||||
if (runnerVersion != null)
|
||||
{
|
||||
queryParams.Add("runnerVersion", runnerVersion);
|
||||
@@ -142,7 +143,6 @@ namespace GitHub.Actions.RunService.WebApi
|
||||
}
|
||||
|
||||
public async Task<TaskAgentSession> CreateSessionAsync(
|
||||
|
||||
TaskAgentSession session,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
@@ -191,6 +191,76 @@ namespace GitHub.Actions.RunService.WebApi
|
||||
throw new Exception($"Failed to delete broker session: {result.Error}");
|
||||
}
|
||||
|
||||
public async Task AcknowledgeRunnerRequestAsync(
|
||||
string runnerRequestId,
|
||||
Guid? sessionId,
|
||||
string runnerVersion,
|
||||
TaskAgentStatus? status,
|
||||
string os = null,
|
||||
string architecture = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
// URL
|
||||
var requestUri = new Uri(Client.BaseAddress, "acknowledge");
|
||||
|
||||
// Query parameters
|
||||
List<KeyValuePair<string, string>> queryParams = new List<KeyValuePair<string, string>>();
|
||||
if (sessionId != null)
|
||||
{
|
||||
queryParams.Add("sessionId", sessionId.Value.ToString());
|
||||
}
|
||||
if (status != null)
|
||||
{
|
||||
queryParams.Add("status", status.Value.ToString());
|
||||
}
|
||||
if (runnerVersion != null)
|
||||
{
|
||||
queryParams.Add("runnerVersion", runnerVersion);
|
||||
}
|
||||
if (os != null)
|
||||
{
|
||||
queryParams.Add("os", os);
|
||||
}
|
||||
if (architecture != null)
|
||||
{
|
||||
queryParams.Add("architecture", architecture);
|
||||
}
|
||||
|
||||
// Body
|
||||
var payload = new Dictionary<string, string>
|
||||
{
|
||||
["runnerRequestId"] = runnerRequestId,
|
||||
};
|
||||
var requestContent = new ObjectContent<Dictionary<string, string>>(payload, new VssJsonMediaTypeFormatter(true));
|
||||
|
||||
// POST
|
||||
var result = await SendAsync<object>(
|
||||
new HttpMethod("POST"),
|
||||
requestUri: requestUri,
|
||||
queryParameters: queryParams,
|
||||
content: requestContent,
|
||||
readErrorBody: true,
|
||||
cancellationToken: cancellationToken);
|
||||
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (TryParseErrorBody(result.ErrorBody, out BrokerError brokerError))
|
||||
{
|
||||
switch (brokerError.ErrorKind)
|
||||
{
|
||||
case BrokerErrorKind.RunnerNotFound:
|
||||
throw new RunnerNotFoundException(brokerError.Message);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception($"Failed to acknowledge runner request. Request to {requestUri} failed with status: {result.StatusCode}. Error message {result.Error}");
|
||||
}
|
||||
|
||||
private static bool TryParseErrorBody(string errorBody, out BrokerError error)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(errorBody))
|
||||
|
||||
@@ -17,7 +17,7 @@ LAYOUT_DIR="$SCRIPT_DIR/../_layout"
|
||||
DOWNLOAD_DIR="$SCRIPT_DIR/../_downloads/netcore2x"
|
||||
PACKAGE_DIR="$SCRIPT_DIR/../_package"
|
||||
DOTNETSDK_ROOT="$SCRIPT_DIR/../_dotnetsdk"
|
||||
DOTNETSDK_VERSION="8.0.412"
|
||||
DOTNETSDK_VERSION="8.0.413"
|
||||
DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION"
|
||||
RUNNER_VERSION=$(cat runnerversion)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "8.0.412"
|
||||
"version": "8.0.413"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user