Coding Spirit

一位程序员,比较帅的那种

If set runs-on as ubuntu-latest, user can use Github CLI tool gh to set secret in actions:

1
2
3
4
5
6
7
- name: Set ECR credentials
id: set-ecr-credentials
run: |
gh auth login --with-token <<< ${{ secrets.PA_TOKEN }}
gh secret set ECR_REGISTRY --body ${{ steps.login-ecr.outputs.registry }} --repo ${{ github.repository }}
gh secret set ECR_USERNAME --body ${{ steps.login-ecr.outputs.username }} --repo ${{ github.repository }}
gh secret set ECR_PASSWORD --body ${{ steps.login-ecr.outputs.password }} --repo ${{ github.repository }}

Using following command to delete all workflow runs on GitHub actions of a specific branch:

1
user=GH_USERNAME repo=REPO_NAME; gh api repos/$user/$repo/actions/runs \--paginate -q '.workflow_runs[] | select(.head_branch == "master") | "\(.id)"' | \xargs -n1 -I % gh api repos/$user/$repo/actions/runs/% -X DELETE

Replace GH_USERNAME and REPO_NAME with your parameters.

You need to install GitHub CLI tool gh first.

1
raspivid -o - -t 0 | cvlc -v stream:///dev/stdin --sout '#rtp{sdp=rtsp://:5554/}' :demux=h264

AWS doesn’t provide official AWS CLI V2 binary release for Raspberry Pi. To install V2 on Raspberry Pi, we have to install it from source:

1
2
3
4
git clone https://github.com/aws/aws-cli.git
cd aws-cli && git checkout v2
sudo pip3 install -r requirements.txt
sudo pip3 install . --prefix /usr/local

GNU linker provides an --wrap option which can help developer replace symbols easily.

Read more »
0%