how can I automatically push a code in issues?

I need to change a url inside of my code by creating an issue which has a new url.

so when someone creates an issue, it will automatically change the url into new one.

is it possible with issues and actions?

are there any other way I can do this?

@lakinduk ,

Maybe you can try using environment variable to pass and update the URL in your code files:

  1. In your code files, use an environment variable (suppose named " ISSUE_URL") to reference the URL.

  2. Setup a workflow runs on the events related to issue, such as Issue comment event and Issues event.

    on:
    issue_comment:
    types: [created, edited]
    issues:
    types: [opened]

  3. If you want to pass the URL of the new issue (for example, https://github.com/myOrg/myRepo/issues/1) via the workflow, you can use the expression syntax ${{ github.event.issue.html_url }} to get the URL from the github context, then use the “env” key to set it as the environment variable " ISSUE_URL".

    env:
    ISSUE_URL: ${{ github.event.issue.html_url }}

  4. If the URL is posted as a comment in the issue,workflow is triggered by issue_comment event, you can use can use the expression syntax ${{ github.event.comment.body }} to get the URL in the latest comment from the github context.

    env:
    ISSUE_URL: ${{ github.event.comment.body }}

  5. After above settings, when you checkout and build your code in the same workflow, it will reference the environment variable " ISSUE_URL" to set the URL in the code files.

  6. If you want to use an explicit URL string in your code files, instead of referencing an environment variable. In the workflow, after checkout the code, you may need to setup an extra steps to execute some related commands or other available methods (according to the type of the code files) to pass the value of environment variable into the code files to overwrite the old URL.