8000 Test commit for environments gating by InStallker · Pull Request #21 · Test-anaconda-org/anaconda · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Test commit for environments gating #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 3 additions & 29 deletions .github/workflows/tests-owners.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,9 @@
name: Run validation tests for owners
on: [push, pull_request_target]
on: pull_request_target

jobs:
pr-info:
runs-on: ubuntu-latest
steps:
- name: Query author repository permissions
uses: octokit/request-action@v2.x
id: user_permission
with:
route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.sender.login }}/permission
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# restrict running of tests to users with admin or write permission for the repository
# see https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-repository-permissions-for-a-user
# store output if user is allowed in allowed_user job output so it has to be checked in downstream job
- name: Check if user does have correct permissions
if: contains('admin write', fromJson(steps.user_permission.outputs.data).permission)
id: check_user_perm
run: |
echo "User '${{ github.event.sender.login }}' has permission '${{ fromJson(steps.user_permission.outputs.data).permission }}' allowed values: 'admin', 'write'"
echo "::set-output name=allowed_user::true"

outputs:
allowed_user: ${{ steps.check_user_perm.outputs.allowed_user }}

unit-tests:
needs: pr-info
if: needs.pr-info.outputs.allowed_user == 'true'
environment: gate-contributors
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
Expand Down Expand Up @@ -105,8 +80,7 @@ jobs:
path: test-logs/*

rpm-tests:
needs: pr-info
if: needs.pr-info.outputs.allowed_user == 'true'
environment: gate-contributors
runs-on: ubuntu-20.04
timeout-minutes: 30
strategy:
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Test

Contribution guidelines
=======================

Expand Down
0