-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37c1604
commit 1bdd967
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Selenology | ||
on: | ||
issue_comment: | ||
types: [created] | ||
jobs: | ||
selenology: | ||
if: ${{ github.event.issue.pull_request }} && ${{ github.event.sender.login }} == "Kampfkarren" && ${{ contains(github.event.comment.body, '!selenology') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get PR info | ||
uses: octokit/[email protected] | ||
id: get_pr_info | ||
with: | ||
query: | | ||
query getPullRequestInfo($owner:String!,$repo:String!,$number:Int!) { | ||
repository(owner: $owner, name: $repo) { | ||
pullRequest(number:$number) { | ||
repository { | ||
url | ||
} | ||
headRefOid | ||
} | ||
} | ||
} | ||
owner: ${{ github.event.repository.owner.login }} | ||
repo: ${{ github.event.repository.name }} | ||
number: ${{ github.event.issue.number }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run selenology | ||
id: selenology | ||
uses: Kampfkarren/selenology@main | ||
with: | ||
new_selene_checkout: ${{ fromJSON(steps.get_pr_info.outputs.data).repository.pullRequest.headRefOid }} | ||
new_selene_repository: ${{ fromJSON(steps.get_pr_info.outputs.data).repository.pullRequest.repository.url }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: selenology-outputs | ||
path: selenology-outputs | ||
- name: Upload output | ||
id: upload | ||
run: | | ||
cd $GITHUB_WORKSPACE/selenology-outputs | ||
FILENAME=selenology-outputs/output-$(date +%s).html | ||
mkdir -p selenology-outputs | ||
cat <<'EOF' >>$FILENAME | ||
${{ steps.selenology.outputs.output }} | ||
EOF | ||
git config user.name "Selenology" | ||
git config user.email "<>" | ||
git add selenology-outputs/ | ||
git commit -m "Add selenology outputs." | ||
git push origin selenology-outputs | ||
echo "::set-output name=filename::$FILENAME" | ||
- name: Post comment | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
body: | | ||
Selenology report was created, and can be viewed [at this link](https://htmlpreview.github.io/?https://github.com/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/blob/selenology-outputs/${{ steps.upload.outputs.filename }}). |