Skip to content

fix DIRECTORY.md is not properly formatted. #3922 #4124

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

Merged
merged 4 commits into from
Apr 1, 2023

Conversation

JiaZombie
Copy link
Contributor

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Could you make it run on every push and pull request? I don't think running it an extra time should be a problem.
image

@JiaZombie
Copy link
Contributor Author

Could you make it run on every push and pull request? I don't think running it an extra time should be a problem. image

It now runs on every push and pull request。Maybe I didn’t understand what you meant。

@siriak
Copy link
Member

siriak commented Mar 28, 2023

I meant to change it to on: [push, pull_request], but it's not that important. There's a bigger problem with permissions , which means that the directory file is not updated as the workflow runs:
image
Do you know what the problem might be and how can I grant those permissions?

@JiaZombie
Copy link
Contributor Author

JiaZombie commented Mar 28, 2023

I meant to change it to on: [push, pull_request], but it's not that important. There's a bigger problem with permissions , which means that the directory file is not updated as the workflow runs: image Do you know what the problem might be and how can I grant those permissions?

There are two way to grant those permissions. One is to change the settings of the repository(In my fork repository,I change the Workflow permissions to Read and write permissions, and it works), see Managing GitHub Actions settings for a repository,the other is use permissions key to grant permissions,see Assigning permissions to jobs. By the way, if change the multipie events to on: [push, pull_request] then we can not configure a workflow to run based on what file paths are changed. see Using activity types and filters with multiple events

siriak
siriak previously approved these changes Mar 29, 2023
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@siriak
Copy link
Member

siriak commented Mar 29, 2023

I've checked logs of the last run, and it didn't work, even though an updated DIRECTORY was committed somehow.
In the repo settings actions are allowed to write
image
Could you add override of permissions in this job? Like that, maybe more permissions are needed than is on the screenshot
image

this workflow only update directories of java file,so the `path` filter only need `src/**`
@JiaZombie JiaZombie force-pushed the master branch 2 times, most recently from 5f2dd87 to 54f723e Compare March 29, 2023 17:54
@JiaZombie
Copy link
Contributor Author

JiaZombie commented Mar 29, 2023

I've checked logs of the last run, and it didn't work, even though an updated DIRECTORY was committed somehow. In the repo settings actions are allowed to write image Could you add override of permissions in this job? Like that, maybe more permissions are needed than is on the screenshot image

I found that the permissions key only worked on my forked repository, so need you selected the Send write tokens to workflows from pull requests option in the GitHub Actions settings at Managing GitHub Actions settings for a repository.
image.
And I have added override of permissions in this job, only need a contents: write permission for a commit operation. This workflow only update the directory info of java files, so I removed some unnecessary paths filter. In case of this pull request wont trigger the workflow after remove some paths filter, I add a workflow_dispatch key to manually running this workflow.these all worked on my forked repository.
image
The "updated DIRECTORY" commit was the workflow run on my forked repository, then the git actions auto commit and push to this pull request, I have reseted the commit.

@siriak siriak enabled auto-merge (squash) April 1, 2023 18:43
Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

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

Thanks, will see how it works!

@siriak siriak merged commit acfa289 into TheAlgorithms:master Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants