Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

feat: Added workflow to protect content #320

Merged
merged 4 commits into from
May 26, 2020

Conversation

alexandrtovmach
Copy link
Contributor

  1. We need to set up GITHUB_TOKEN to secrets (I haven't admin rights in repo to do by my own)
  2. Probably I need to make a few iterations to debug and test workflow

@alexandrtovmach
Copy link
Contributor Author

Hmm... but I can test it with direct PR to patch/protect-content

@nodejs nodejs locked and limited conversation to collaborators Apr 22, 2020
@nodejs nodejs unlocked this conversation Apr 22, 2020
@nschonni
Copy link
Member

Think the problem with this is that pull requests from forks won't have access to secrets either way

@alexandrtovmach
Copy link
Contributor Author

Is not a fork;)

@nschonni
Copy link
Member

No, but if you're trying to prevent pull requests coming from forks, I don't think the Action will be able to access when triggered from forks

@alexandrtovmach
Copy link
Contributor Author

@nschonni Are you sure that this limitation applies to public repos?
All discussions that I found are about private repos GitHub Forums:

From GitHub Action docs:

When you create a pull request from a forked repository to the base repository, GitHub sends the pull_request event to the base repository and no pull request events occur on the forked repository.
Workflows don't run on forked repositories by default. You must enable GitHub Actions in the Actions tab of the forked repository.
The permissions for the GITHUB_TOKEN in forked repositories is read-only. For more information, see "Authenticating with the GITHUB_TOKEN."

on:
pull_request:
paths:
- 'content/**'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would allow changes to the English content like when adding a new version

Suggested change
- 'content/**'
- 'content/**'
- "!content/*/en-US/**"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would allow changes to the English content like when adding a new version

All content inside content/ must be changed automatically with bots (@nodejs-crowdin and @github-actions).
Workflow

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't happen for new Node versions through the sync right now, it relies on the folder being adding in addtion to the package.json change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nschonni if we are going to land #313 this wouldn't be a problem

.github/workflows/check-i18n-changes.yml Outdated Show resolved Hide resolved
.github/workflows/check-i18n-changes.yml Outdated Show resolved Hide resolved
on:
pull_request:
paths:
- 'content/**'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would allow changes to the English content like when adding a new version

All content inside content/ must be changed automatically with bots (@nodejs-crowdin and @github-actions).
Workflow

.github/workflows/check-i18n-changes.yml Outdated Show resolved Hide resolved
.github/workflows/check-i18n-changes.yml Show resolved Hide resolved
Co-authored-by: Nick Schonning <[email protected]>
Co-authored-by: Tiago Danin <[email protected]>
@alexandrtovmach
Copy link
Contributor Author

It's not merged yet, because related to #313

@alexandrtovmach
Copy link
Contributor Author

Blocker PR is already merged

@alexandrtovmach alexandrtovmach merged commit 8bb3cef into master May 26, 2020
@alexandrtovmach alexandrtovmach deleted the patch/protect-content branch May 26, 2020 08:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Protect folders with translated content from manual updates
3 participants