Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An (unofficial) Github command line client (based on Api V3):octocat:

License

NotificationsYou must be signed in to change notification settings

fulll/github

Repository files navigation

Go Report Card

This command line client is based on Github API V3.

What it does

You can manipulate following Github resources:

What it will (probably) never do

Managing resources like pull requests, issues or repositories life cycle andsettings for example.

Some very good tools likehub orterraform providerare already great at doing that.

How to install it?

go get github.com/fulll/github

or you can use the install script:

curl -qs https://raw.githubusercontent.com/fulll/github/master/install.sh| bash -

or a simplified version (feel free to replacelinux by eitherwindows ordarwin)

curl -s https://api.github.com/repos/fulll/github/releases/latest|jq -r'.assets[] | select(.name | test("linux-amd64$")) | .browser_download_url'|wget -qi - -O github&& chmod +x github

Why another Github client?

The goal is to have a convenient, lightweight tool to use inside githubactions v2 workflows.

Some use cases that motivated the creation of this tool were:

How it can help you in github actions v2?

Continuous deployment on staging

name:trigger staging deployment on pull request mergedon:push:branches:[master, dev]jobs:deploy:runs-on:ubuntu-lateststeps:      -run:echo build app      -run:curl -qs https://raw.githubusercontent.com/fulll/github/master/install.sh | bash -      -id:deploymentenv:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}run:|          id=$(github deployment create --productionEnvironment=false --environment staging $GITHUB_REF)          github deployment_status create $id in_progress          echo "##[set-output name=deployment_id;]$id"      -env:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}ID:${{ steps.deployment.outputs.deployment_id }}run:|          echo deploy app          github deployment_status create $ID success      -if:failure()env:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}ID:${{ steps.deployment.outputs.deployment_id }}run:github deployment_status create $ID failure

Continuous delivery on production

name:create production deployment on release publishedon:releasejobs:is-published:runs-on:ubuntu-lateststeps:      -if:github.event.action != 'published'run:exit 1build:runs-on:ubuntu-latestneeds:is-publishedsteps:      -run:echo build appcreate-deployment:runs-on:ubuntu-latestneeds:buildsteps:# # optional: install hub# - run: |#     curl -s https://api.github.com/repos/github/hub/releases/latest |#     jq -r '.assets[] | select(.name | contains("linux-amd64")) | .browser_download_url' |#     wget -qi - -O - | sudo tar xzpf - -C / --strip-components=1# - uses: actions/checkout@master      -run:curl -qs https://raw.githubusercontent.com/fulll/github/master/install.sh | bash -      -id:deploymentenv:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}run:|          id=$(github deployment create $GITHUB_REF)          echo "##[set-output name=deployment_id;]$id"# #-----------------------------8<----------------------------------------# # here: some job(s) to add for example a deploy button/process# - uses: some-deploy-button-action#   id: button#   with:#     deployment_id: ${{ steps.deployment.outputs.deployment_id }}# - name: append button to release note#   env:#     DEPLOY_BUTTON: ${{ steps.button.outputs.release-button }}#     TAG_NAME: ${{ github.event.release.tag_name }}#     GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}#     GITHUB_USER: ${{ github.actor }}#   run: |#     button=$(printf '\n## Deploy to production :rocket:\n%s\n' "$DEPLOY_BUTTON")#     hub release edit -m "" -m "$(hub release show $TAG_NAME -f %b)" -m "$button" $TAG_NAME# #-----------------------------8<----------------------------------------

Then, some external approbation process put the deployment status toin_progressand you effectively deploy on production 🎉

name:deploy on productionon:deployment_statusjobs:should-deploy:runs-on:ubuntu-lateststeps:      -if:github.event.deployment.original_environment != 'production' || github.event.deployment_status.state != 'in_progress'run:exit 1deploy:needs:should-deployruns-on:ubuntu-lateststeps:      -run:curl -qs https://raw.githubusercontent.com/fulll/github/master/install.sh | bash -      -env:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}ID:${{ github.event.deployment.id }}run:|          echo deploy app          github deployment_status create $ID success      -if:failure()env:GITHUB_TOKEN:${{ secrets.GITHUB_TOKEN }}ID:${{ github.event.deployment.id }}run:github deployment_status create $ID failure

[8]ページ先頭

©2009-2025 Movatter.jp