Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test setup-adc
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test-latest:
name: Test latest version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup ADC (latest)
uses: ./
id: setup

Comment thread
bzp2010 marked this conversation as resolved.
- name: Verify installation
run: |
adc --version
echo "Installed version: ${{ steps.setup.outputs.adc-version }}"

test-specific-version:
name: Test specific version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup ADC (v0.24.0)
uses: ./
with:
version: 0.24.0

- name: Verify version
run: adc --version | grep -F 0.24.0

test-arm64:
name: Test ARM64
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4

- name: Setup ADC (ARM64)
uses: ./
id: setup

- name: Verify installation
run: |
adc --version
echo "Installed version: ${{ steps.setup.outputs.adc-version }}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
*.tsbuildinfo
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist
/coverage
20 changes: 20 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"plugins": [
"@trivago/prettier-plugin-sort-imports"
],
"importOrder": [
"^[./]"
],
"importOrderParserPlugins": [
"typescript",
"decorators-legacy"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"endOfLine": "lf",
"printWidth": 80
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Setup ADC

This action sets up the [api7/adc](https://github.com/api7/adc) CLI tool for use in GitHub Actions workflows.

## Usage

> **Security:** Pin your workflow to a specific [release tag](https://github.com/api7/setup-adc/releases)
> (e.g. `@v1`) or, for maximum immutability, a full commit SHA
> (e.g. `@a824008085750b8e136effc585c3cd6082bd575f`). Using `@main`
> is convenient for development but may introduce breaking changes unexpectedly.

<!-- x-release-please-start-version -->
```yaml
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: api7/setup-adc@v1
id: setup
with:
version: 0.25.0 # optional, defaults to latest

Comment thread
bzp2010 marked this conversation as resolved.
- run: adc --version
- run: adc ping
```
<!-- x-release-please-end -->

## Inputs

| Input | Description | Required | Default |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------- |
| `version` | Version of ADC to install (e.g. `0.25.0`, `latest`) | No | `latest` |
| `token` | GitHub token for API requests. Typically not supplied by the user — the default is sufficient on github.com. On GHES, pass a PAT if rate limited. | No | `${{ github.server_url == 'https://github.com' && github.token | | '' }}` |

Comment thread
bzp2010 marked this conversation as resolved.
Comment thread
bzp2010 marked this conversation as resolved.
Comment on lines +28 to +34
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether action.yml exposes a `token` input and whether it is required.
fd -i '^action\.yml$' -X sed -n '1,220p'

Repository: api7/setup-adc

Length of output: 680


Add token input to the inputs table in README.

The action.yml file defines a token input that is not documented in the README's inputs table (lines 28-33). The token input is optional and defaults to ${{ github.token }}, used for fetching the latest release from the GitHub API. Update the README to document this input alongside version to prevent integration confusion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 28 - 33, Update the README inputs table to include
the missing token input defined in action.yml: add a new row for `token` with a
brief description like "GitHub token used to fetch the latest release from the
GitHub API", mark it as not required (No) and set the Default to `${{
github.token }}` so it appears alongside the existing `version` input in the
Inputs table; ensure the column order and formatting match the existing table
for `version`.

## Outputs

| Output | Description |
| ------------- | ------------------------- |
| `adc-version` | The installed ADC version |

Comment thread
bzp2010 marked this conversation as resolved.
## License

Apache-2.0
26 changes: 26 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Setup ADC"
description: "Setup the API7 ADC CLI tool"
author: "API7"
branding:
icon: "terminal"
color: "blue"
inputs:
version:
description: >
Version of ADC to install. Examples: 0.25.0, v0.25.0. Defaults to the
latest available version when not specified.
default: "latest"
token:
description: >
Used to fetch the latest ADC release from the GitHub API. Since there is a
default, this is typically not supplied by the user. When running this
action on github.com, the default value is sufficient. When running on
GHES, you can pass a personal access token for github.com if you are
experiencing rate limiting.
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
outputs:
adc-version:
description: "The installed ADC version"
runs:
using: "node24"
main: "dist/index.js"
Loading
Loading