File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,27 @@ action:
1111 maxParallel : 1
1212 maxTotal : 10
1313 steps :
14+ - task :
15+ command : |
16+ set -e
17+ if ! command -v gh &>/dev/null; then
18+ echo "Installing GitHub CLI..."
19+ (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y))
20+ sudo mkdir -p -m 755 /etc/apt/keyrings
21+ out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
22+ sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
23+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
24+ sudo apt update && sudo apt install gh -y
25+ fi
26+ echo "gh version: $(gh --version | head -1)"
27+ TOKEN=$(git credential fill <<EOF | grep password | cut -d= -f2
28+ protocol=https
29+ host=github.com
30+
31+ EOF
32+ )
33+ echo "$TOKEN" | gh auth login --with-token
34+ gh auth status
1435 - agent :
1536 prompt : |
1637 Query the GitHub code scanning alerts for this repository using the GitHub CLI:
Original file line number Diff line number Diff line change @@ -11,6 +11,27 @@ action:
1111 maxParallel : 1
1212 maxTotal : 10
1313 steps :
14+ - task :
15+ command : |
16+ set -e
17+ if ! command -v gh &>/dev/null; then
18+ echo "Installing GitHub CLI..."
19+ (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y))
20+ sudo mkdir -p -m 755 /etc/apt/keyrings
21+ out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
22+ sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
23+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
24+ sudo apt update && sudo apt install gh -y
25+ fi
26+ echo "gh version: $(gh --version | head -1)"
27+ TOKEN=$(git credential fill <<EOF | grep password | cut -d= -f2
28+ protocol=https
29+ host=github.com
30+
31+ EOF
32+ )
33+ echo "$TOKEN" | gh auth login --with-token
34+ gh auth status
1435 - agent :
1536 prompt : |
1637 Query the GitHub Dependabot alerts for this repository using the GitHub CLI:
You can’t perform that action at this time.
0 commit comments