Bug 1598118 [wpt PR 20348] - [ci] Change name of environment variable, a=testonly

Automatic update from web-platform-tests
[ci] Change name of environment variable (#20348)

The GitHub Workflow documentation warns against environment variable
names that begin with the sequence `GITHUB_`:

> **Note:** GitHub reserves the `GITHUB_` environment variable prefix
> for internal use by GitHub. Setting an environment variable or secret
> with the `GITHUB_` prefix will result in an error.

Source: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#naming-conventions-for-environment-variables

Although early experiments have shown that it was recently possible to
override the `GITHUB_TOKEN` environment variable, the latest behavior of
the modified GitHub Workflows suggests that the overridden value is
being silently rejected. (Additionally, the disparity between GitHub
Secret name and environment variable name is somewhat confusing.)

Update the configuration to define an environment variable with an
allowed name--one that matches the name of the corresponding GitHub
Secret. Update the relevant scripts to reference this new variable.
Change the access pattern to a mechanism which will trigger a runtime
exception when the variable is not defined.
--

wpt-commits: 3f9fbdbefd8db5fdacd930d31e1402be61438b17
wpt-pr: 20348
This commit is contained in:
jugglinmike 2019-11-26 11:26:52 +00:00 коммит произвёл moz-wptsync-bot
Родитель 7ea8e42b07
Коммит 6ba4afde92
4 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -21,4 +21,4 @@ jobs:
--target https://wptpr.live
--timeout 600
env:
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}

Просмотреть файл

@ -26,4 +26,4 @@ jobs:
# "DEPLOY_TOKEN" in this GitHub project.
#
# [1] https://help.github.com/en/github/automating-your-workflow-with-github-actions/events-that-trigger-workflows
GITHUB_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}

Просмотреть файл

@ -44,7 +44,7 @@ logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def gh_request(method_name, url, body=None, media_type=None):
github_token = os.environ.get('GITHUB_TOKEN')
github_token = os.environ['DEPLOY_TOKEN']
kwargs = {
'headers': {
@ -200,7 +200,7 @@ class Remote(object):
# The repository in the GitHub Actions environment is configured with
# a remote whose URL uses unauthenticated HTTPS, making it unsuitable
# for pushing changes.
self._token = os.environ.get('GITHUB_TOKEN')
self._token = os.environ['DEPLOY_TOKEN']
def get_revision(self, refspec):
output = subprocess.check_output([

Просмотреть файл

@ -191,7 +191,7 @@ def temp_repo():
def synchronize(expected_traffic, refs={}):
env = {
'GITHUB_TOKEN': 'c0ffee'
'DEPLOY_TOKEN': 'c0ffee'
}
env.update(os.environ)
server = MockServer((test_host, 0), expected_traffic)
@ -250,7 +250,7 @@ def synchronize(expected_traffic, refs={}):
def detect(event, expected_github_traffic, expected_preview_traffic):
env = {
'GITHUB_TOKEN': 'c0ffee'
'DEPLOY_TOKEN': 'c0ffee'
}
env.update(os.environ)
github_server = MockServer((test_host, 0), expected_github_traffic)