Trigger deployment_status from within another Github action - github

I have one action that sets the deployment status to success which in turn should trigger another action but that does not seem to work. Isn’t it possible to listen for deployment_status changes in one action that are triggered from within another action?

By design, an action in a workflow run can’t trigger a new workflow run with the default GitHub token. Please refer to the official doc for more details.
Creating personal access token as secrets instead is the workaround.

Related

GitHub Action: Provide webhook callback URL custom and wait for completion

I am looking for a method to generate a custom webhook callback URL unique to each build within my github action. The purpose of this is that I have a github action which simply starts a test on a server (i.e. browserstack)and returns. It has the option to provide a webhook to call upon test completion.
I ideally would want to somehow generate a webhook custom to this build, and then trigger another action which waits for the webhook callback before continuing. I can always have a polling mechanism which runs every 60 seconds, but I personally prefer to avoid this.

Generating Github events from Github Workflows with the right user

In order to prevent recursive workflow execution Github will not execute workflows triggered by events raised in other workflows.
The known workaround for this is to use a separate Token stored as a secret on the pipeline. However, this means that all subsequent workflows will be run with the user who generate the token and not the user who generated the initial event.
Is there a better way to deliberately trigger workflows via events (i.e. creating a deployment) without having the triggered workflows executed always with the same user?

Is there any away to trigger GitHub action workflow from Shiny Dashboard?

I'm looking for a way to trigger GitHub action workflow from the dashboard by simply clicking on a button. Also, is there any way to embed live logs of GitHub workflows on shiny dashboard.
You can use the respository_dispatch event to trigger the workflow. Once the action is configured you can create a dispatch event by doing a POST request to GitHub API dispatches endpoint.
POST /repos/{owner}/{repo}/dispatches
Refer docs for more info.

Can Personal Access Token with limited scope be shared with other users?

I'm building a CLI which triggers an Action (using workflow_dispatch) in my repository. I'm using Github API to perform this task. Taken from the docs:
You must authenticate using an access token with the repo scope to use this endpoint.
I've generated a PAT with repo scope to authenticate myself. I want users to run this CLI. Is it safe to share this PAT (which has repo as the only scope)?
p.s. I know it is ironical to ask if "Personal"-access-token can be "shared". But I don't see any problem it can cause with its limited scope.
I don't think it is a good idea. Repo scope is not limited to only one repo.
If you want to trigger actions by external users, your best bet would probably be to create a workflow running on PR or Issue events.
Allow your users to create issues
Monitor keywords or label on the issue
Trigger your action.

Github Pull Request Checks

Is it possible to create a Github Check for pull requests? I know there are WebHooks, but is there a way to also hook into the UI?
Aim:
Pull Request made. Perform validation and update pull request if valid.
Pull Request merged. Create web call to URL. Update Github issue with confirmation.
What's the best way to do this? Is it only via Web Hooks, API calls and getting write oAuth credentials?
Note: you now (August 2018) officially have the notion of Checks
When checks are set up in a repository, pull requests have a Checks tab where you can view detailed build output from status checks and rerun failed checks.
I know there are WebHooks, but is there a way to also hook into the UI?
The recommended way of doing this is to use required status checks and the Status API, in combination with webhooks:
https://help.github.com/articles/about-required-status-checks/
https://developer.github.com/v3/repos/statuses/
Users set up required status checks on the repository so that merging a pull request is blocked if a specific status isn't success.
At the same time, webhooks trigger an external process when a pull request is updated, and that process creates statuses based on the output of that process. If the process completes successfully, then the process should create a success status which will be shown in the UI and unblock the merging of the pull request.
Is it only via Web Hooks, API calls and getting write oAuth credentials?
In order to create statuses, you will indeed need to authenticate with the credentials of a user that has push access to the repository (e.g. via a token from that user with the right scopes).