Skip to content
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

Not able to configure Personal Access Token with Secret #32

Open
yash982000 opened this issue Aug 19, 2021 · 16 comments
Open

Not able to configure Personal Access Token with Secret #32

yash982000 opened this issue Aug 19, 2021 · 16 comments

Comments

@yash982000
Copy link

Hello, I have tried to configure as per the steps provided but was not been able to find out what is wrong.

I am a bit confused about the steps that how to use the personal access token with the encrypted secrets.

Please help.

@shunjid @zubayerhimel @fahad1997 @jinnatul @abusufianshibli

@yash982000
Copy link
Author

To be precise, I am confused about where to provide the personal access token name and where to put the secret token.

@hrittikhere
Copy link

Did you go through this?

@Teamtigers256
Copy link

Hello @yash982000,

Sorry for the late reply.

You have to set up the secret token in the settings of your repository. Please go through this documentation from GitHub: https://docs.github.com/en/actions/reference/encrypted-secrets

Make sure that the secret name is TOKEN like the screenshot below.

Screenshot from 2021-08-20 10-59-00

Let us know if that helps.

@yash982000
Copy link
Author

Did you go through this?

YES!!

@yash982000
Copy link
Author

Hello @yash982000,

Sorry for the late reply.

You have to set up the secret token in the settings of your repository. Please go through this documentation from GitHub: https://docs.github.com/en/actions/reference/encrypted-secrets

Make sure that the secret name is TOKEN like the screenshot below.

Screenshot from 2021-08-20 10-59-00

Let us know if that helps.

Ok.

Then where do I put the personal access token.

And ,also is something to be put in value?

@Teamtigers256
Copy link

Screenshot from 2021-08-20 11-51-48

@yash982000 TOKEN should be the name and your personal access token should be the value like the screenshot.

@yash982000
Copy link
Author

Screenshot from 2021-08-20 11-51-48

@yash982000 TOKEN should be the name and your personal access token should be the value like the screenshot.

I tried this but the pull request for minification isn't working yet.

I want to setup a workflow such as on commit it checks for minification.

name: minisauras

on: [push]

jobs:
  read:
    runs-on: ubuntu-18.04

    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: minisauras
      uses: TeamTigers/[email protected]
      env:
        GITHUB_TOKEN: ${{ secrets.TOKEN }}
      id: dir
      with:
        directory: './' ## minify all files from root directory

What should I write inside "ON" such that it triggers while I commit on that default branch?

Much help appreciated.

@Teamtigers256
Copy link

Hey @yash982000,

Whenever you merge other branches to your base branch or push directly any changes to your base branch then the action will be able to minify only when you give both read and write access for your personal access token. It will send a pull request to your repository.

Can you please check if your token has both read and write permission?

@Teamtigers256
Copy link

You may also check the example repository which is using minisauras: https://github.com/TeamTigers/minisauras-example

@yash982000
Copy link
Author

permissions:
  contents: read
  pull-requests: write

This should do the work right?

Also, I have checked this settings.

image

@Teamtigers256
Copy link

Hello @yash982000,

Yes, this should work.
Can you please check if there is an error in the actions log from your action running history?

@yash982000
Copy link
Author

Heyy @Teamtigers256

No error on logs.

image

image

All are showing success. But no pull request and changes.

@yash982000
Copy link
Author

Also, I wasted some a lot of scheduled actions minutes
But no minification done.

Can you please help?

@yash982000
Copy link
Author

Hello @yash982000,

Yes, this should work.
Can you please check if there is an error in the actions log from your action running history?

Hello @Teamtigers256

Any updates on this?

I am unable to troubleshoot what is the problem as it is never shown.

Although now, when a new code is pushed to the branch, it shows minisauras run successfully.
So, is there an issue with the triggering of the pull requests?

Here is the screenshot of how the workflow is triggered one pushed some code:-

image

@yash982000
Copy link
Author

@Teamtigers256 @hrittikhere

Much help appreciated!!

@yash982000
Copy link
Author

Hello @yash982000,
Yes, this should work.
Can you please check if there is an error in the actions log from your action running history?

Hello @Teamtigers256

Any updates on this?

I am unable to troubleshoot what is the problem as it is never shown.

Although now, when a new code is pushed to the branch, it shows minisauras run successfully.
So, is there an issue with the triggering of the pull requests?

Here is the screenshot of how the workflow is triggered one pushed some code:-

image

@hrittikhere @Teamtigers256 @shunjid @zubayerhimel

Can anyone please help?

I have troubleshot a lot. But do not find anything.

If you have used this earlier, I would be happy to see your working code and would debug it accordingly for my use.
It would be great if you can share your working .yml code here.

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

No branches or pull requests

3 participants